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'
---------------------------------------------------------------
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