Solved

Is QUOTED_IDENTIFIER a database wide setting?

Posted on 2008-10-08
2
421 Views
Last Modified: 2008-10-16
Hello Experts. I noticed that I have to set QUOTED_IDENTIFIER=ON in my stored procedure in order to query from an XML datatype (to get the elements out). Is this QUOTED_IDENTIFIER a setting at the sproc level? That is, if I set QUOTED_IDENTIFIER=ON in one sproc, will it turn it on in the other sprocs within the same database? (I only want this setting in my sproc only and no others) Sorry for the dumb question!
0
Comment
Question by:trpnbillie
2 Comments
 
LVL 35

Accepted Solution

by:
David Todd earned 125 total points
ID: 22675429
Hi,

SET QUOTED_IDENTIFIER is set at parse time. Setting at parse time means that if the SET statement is present in the batch or stored procedure, it takes effect, regardless of whether code execution actually reaches that point; and the SET statement takes effect before any statements are executed.

from ... http://technet.microsoft.com/en-us/library/aa259228(SQL.80).aspx

or
When executed inside a stored procedure, the setting of SET QUOTED_IDENTIFIER is not changed.

from
http://technet.microsoft.com/en-us/library/ms174393(SQL.90).aspx

HTH
  David
0
 

Author Comment

by:trpnbillie
ID: 22687915
Thanks for your response! I think this

When executed inside a stored procedure, the setting of SET QUOTED_IDENTIFIER is not changed.

answers my question.

If at the top of my stored procedure "ProcA"  e.g.

SET QUOTED_IDENTIFIER = ON
GO
CREATE ProcA

That ON setting will not be enforced when other sprocs (ProcB, ProcC, ProcD) are executed? (unless they too have SET QUOTED_IDENTIFIER = ON). Is that right? THank you!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question