Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quoted Identifiers problem

Status
Not open for further replies.

HobbyMan

Programmer
Sep 22, 2000
25
0
0
US
Here is a quote from the books online:

Quoted identifiers are used by default in SQL Server 2000,
that is, they are set to ON. This is different from SQL
Server 7.0 where they were set to OFF by default.


Here is my problem. I developed my system, using v7, to
have double quotes around all of my insert statements (the
strings). Now I move off to a 2k installation and I run
into this problem. I know I can set them to off with this:

SET QUOTED_IDENTIFIER OFF

But what I wish to do is change the database so that the
default is OFF.

How do I do that? I have tried the "Alter Database" command
and the "sp_dboption" command but neither have turned it
off. Here are the statements I ran:


ALTER DATABASE CustomerSupport
SET QUOTED_IDENTIFIER OFF
GO

EXEC sp_dboption 'CustomerSupport','quoted identifier','FALSE'


What is wrong here? Can the default be changed from ON to OFF?

Lance
 
The following came from SQL BOL:
Code:
SET QUOTED_IDENTIFIER must be set to ON when you create or manipulate indexes on computed columns or indexed views. 

Connection-level settings (set using the SET statement) override the default database setting for QUOTED_IDENTIFIER. By default, ODBC and OLE DB clients issue a connection-level SET statement setting QUOTED_IDENTIFIER to ON when connecting to SQL Server. For more information, see SET QUOTED_IDENTIFIER. 

The status of this option can be determined by examining the IsQuotedIdentifiersEnabled property of the DATABASEPROPERTYEX function.

Perhaps you can set quoted identifiers off for every connection you establish...

Kevin
 
One other thought.

How hard would it be to do a search and replace through your project and replace the double quotes with square brackets []?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top