SET QUOTED_IDENTIFIER ON

Sometimes we can’t use single quote. For example we want to update a column and our data contain single quote.In such cases we can use double quote instead of single quote if we SET QUOTED_IDENTIFIER ON.Below first query fails.

SET QUOTED_IDENTIFIER OFF
GO

CREATE TABLE "select"
     (
      "id" INT IDENTITY(2,10) PRIMARY KEY
     ,"firstname" NVARCHAR(100) 
     );
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE "select"
     (
      "id" INT IDENTITY(2,10) PRIMARY KEY
     ,"firstname" NVARCHAR(100) 
     );
GO
Advertisements
This entry was posted in Joy of T-SQL, T-SQL Tips & Tricks. Bookmark the permalink.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s