SET QUOTED_IDENTIFIER (TSQL Statement)

allows double-quotes to delimit identifiers.

Syntax

SET QUOTED_IDENTIFIER { ON | OFF }

Remarks

This option only affects parsing stage, not execution stage.

When SET QUOTED_IDENTIFIER is ON (default):

When SET QUOTED_IDENTIFIER is OFF:

Examples

SET QUOTED_IDENTIFIER ON;

CREATE LOGIN Smith           WITH PASSWORD='xjjierknOeTT467f';
CREATE LOGIN [Jean Dupont]   WITH PASSWORD='7ezhEpoe74Fgf';
CREATE LOGIN "Pierre Kiroul" WITH PASSWORD='89fhdsauiERE-as';

PRINT 'The logins "Smith", "Jean Dupont" and "Pierre Kiroul" have been created.';

GO

SET QUOTED_IDENTIFIER OFF;

DROP LOGIN Smith;
DROP LOGIN [Jean Dupont];

PRINT 'The logins "Smith" and "Jean Dupont" have been dropped.';
PRINT "The login ""Pierre Kiroul"" has also been dropped.";

The result is:

2016/03/31 02:56:48 --- executing batch example.sql:1 ---
The logins "Smith", "Jean Dupont" and "Pierre Kiroul" have been created.
2016/03/31 02:56:48 return code: 0

2016/03/31 02:56:48 --- executing batch example.sql:26 ---
The logins "Smith" and "Jean Dupont" have been dropped.
The login "Pierre Kiroul" has also been dropped.
2016/03/31 02:56:48 return code: 0
RSQL, a simple alternative to Microsoft SQL Server