?
Solved

Is QUOTED_IDENTIFIER a database wide setting?

Posted on 2008-10-08
2
Medium Priority
?
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
David Todd earned 375 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

649 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