|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, February 06, 2013 11:51 PM
Points: 1,263,
Visits: 1,079
|
|
Hugo Kornelis (2/15/2011)The obvious solution would be to start using ANSI-compliant double quotes to delimit identifiers that need to be delimited. 
Hugo,
first of all thanks for your explanation in your previous post and the sample code clearly describing the different outcome based on the quoted identifier setting.
And I wasn't aware of the ANSI compliant variant using double quotes, as the examples in BOL as well as any other code I've seen so far exclusively made use of brackets. So thank you very much for making this point, and I'll definitely start using double quotes .
Regards, Michael
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
|
|
Hugo Kornelis (2/15/2011)
I think the QUOTED_IDENTIFIER setting is to preserve backwards compatibility. With QUOTED_IDENTIFIER set to OFF, SQL Server reverts to its legacy behavior where both single and double quotes delimit strings, and only brackets delimit idenitifeers. With QUOTED_IDENTIFIER set to ON, we get the ANSI standard behavior where single quotes delimit strings and double quotes delimit identifiers, with the support for brackets as identifier delimiters kept in as a bonus. So you could get the third query to run without error message if you first SET QUOTED_IDENTIFIER OFF. As per me, you are correct. We had few stored procedures which were developed during SQL 2000 and due to critical procedures, they were available with latest schema though we upgraded SQL version to SQL 2008. We were created the procedures with SET QUOTED_IDENTIFIER OFF. Just before few days, I had converted the procedures & now they are compatible with SET QUOTED_IDENTIFIER ON.
I also heard that Microsoft should stop the usage of SET QUOTED_IDENTIFIER OFF while creating any objects.
Thanks
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:04 PM
Points: 5,101,
Visits: 20,200
|
|
also heard that Microsoft should stop the usage of SET QUOTED_IDENTIFIER OFF while creating any objects.
Regards, Hardik Doshi
Out of curiosity in 2008 I checked for depreciated items with the following:
SELECT * FROM sys.dm_os_performance_counters WHERE object_name LIKE ('%deprecated%') AND instance_name LIKE('%SET%') Although eleven SET statements were displayed, SET QUOTED_IDENTIFIER was not one of those.
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please read Before posting a performance problem please read
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 11:21 AM
Points: 2,163,
Visits: 2,148
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 3,046,
Visits: 1,303
|
|
| Thanks for the question, and to all who contributed to the ensuing discussion - very informative.
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 18,733,
Visits: 12,332
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Saturday, March 16, 2013 9:53 AM
Points: 847,
Visits: 768
|
|
Nice question.
Thanks, Iulian
|
|
|
|