Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SET QUOTED_IDENTIFIER OFF and usage of double quto
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

596 Posts

Posted - 01/25/2013 :  10:50:23  Show Profile  Reply with Quote
A developer had a stored procedure with this inside:
Print " >>>>> " + @Sql + @Where

I could not compile it, I originally thought it was an error in the code. Then I discovered with SET QUOTED_IDENTIFIER OFF, it would compile.

Does anyone have any thought if this is good coding style, i.e. using the double quotation marks? It seems unusual to me. What is the recommended setting on the Database for "Quoted Identifiers Enabled"?

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 01/25/2013 :  11:23:42  Show Profile  Reply with Quote
By default, it is set to ON, so I leave it at that and use single quotes for strings. Also, some features indexed views, indexes on XML columns etc. require that you set QUOTED_IDENTIFIER ON before you create them. So unless there is a strong reason to do so, leave it ON.
Print ' >>>>> ' + @Sql + @Where
Go to Top of Page

Yak Posting Veteran

72 Posts

Posted - 01/25/2013 :  11:27:09  Show Profile  Reply with Quote
This is one of those things to where that is going to be your call.

Ultimately, I would recommend that you leave it ON and stick with using single quotes since that is the most widely used practice but that is why they give you the option to switch it... The ability to customize things to your liking.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000