Counter of Festivals

Ashok Blog for SQL Learners and Beginners and Experts

Monday 26 May 2014

SET QUOTED_IDENTIFIER ON

SET QUOTED_IDENTIFIER

set quoted_identifier session setting must be set to ON for the quotaion marks to be used for delimited identitfiers. The Defalut setting for SET QUOTED_IDENTIFIER is ON
but Older T-SQL code may rquire it to be set to OFF.
Setting quoted_identifier  to OFF causes SQL Server to interpret the quotation marks as string
Instead of identifiers.

---Standard identifiers-----
create table empsamp(eid int not null)

-----------Delimited identitfiers------

set quoted_identifier ON

create table sampemp("eid" int not null,[ename] varchar(300))

Table created.

select * from sampemp



set quoted_identifier OFF


create table sampdept("did" int not null,[dname] varchar(300))

Incorrect syntax near 'did'

---------------------------------------------------------------

No comments:

Post a Comment