views:

52

answers:

2

When comparing schemas from a SQL 2008 database to a Visual Studio 2010 database project, if the schema name has a space in it, the script generator generates the following:

create view "Alphabetical list of products" AS...

When the database project is built, it throws errors due to incorrect syntax (the double quotes). Is there an option to have the script generator to generate the following so the database project will build?

create view [dbo].[Alphabetical list of products] AS...

A: 

You can use the SET QUOTED IDENTIFIERS to work around this.

http://msdn.microsoft.com/en-us/library/ms174393.aspx

Generally speaking, spaces in object names is not considered a good development practice.

Raj More
A: 

Thanks!

For posterity sake, I was trying to set the QUOTED_IDENTIFIER within the Database Project and within the Schema Comparison options. These settings do not seem to matter if the schema object itself has code within it to set the QUOTED_IDENTIFIER to ON.

Once I changed the schema code to set the QUOTED_IDENTIFIER to OFF, it worked perfectly!

related questions