

When executed inside a stored procedure, the setting of SET QUOTED_IDENTIFIER is not changed. When a stored procedure is created, the SET QUOTED_IDENTIFIER and SET ANSI_NULLS settings are captured and used for subsequent invocations of that stored procedure. When a table is created, the QUOTED IDENTIFIER option is always stored as ON in the table's metadata even if the option is set to OFF when the table is created. The default for SET QUOTED_IDENTIFIER is OFF for connections from DB-Library applications. This can be configured in ODBC data sources, in ODBC connection attributes, or OLE DB connection properties.

QUOTES DATABASE API DRIVER
The SQL Server Native Client ODBC driver and SQL Server Native Client OLE DB Provider for SQL Server automatically set QUOTED_IDENTIFIER to ON when connecting. SET QUOTED_IDENTIFIER must be ON when you invoke XML data type methods. SET QUOTED_IDENTIFIER must be ON when you are creating a filtered index. For more information about required SET option settings with indexed views and indexes on computed columns, see Considerations when you use the SET statements. If SET QUOTED_IDENTIFIER is OFF, then CREATE, UPDATE, INSERT, and DELETE statements will fail on tables with indexes on computed columns, or tables with indexed views. SET QUOTED_IDENTIFIER must be ON when you are creating or changing indexes on computed columns or indexed views. QUOTED_IDENTIFIER does not affect delimited identifiers enclosed in brackets (). If a literal string is delimited by double quotation marks, the string can contain embedded single quotation marks, such as apostrophes. Literals can be delimited by either single or double quotation marks. For more information, see Database Identifiers. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact-SQL rules for identifiers. SET QUOTED_IDENTIFIER must be ON when reserved keywords are used for object names in the database. If a single quotation mark (') is part of the literal string, it can be represented by two single quotation marks (''). Double quotation marks cannot be used to delimit literal string expressions single quotation marks must be used to enclose literal strings. They can be reserved keywords and can include characters not generally allowed in Transact-SQL identifiers. Therefore, quoted identifiers do not have to follow the Transact-SQL rules for identifiers.

All strings delimited by double quotation marks are interpreted as object identifiers. When SET QUOTED_IDENTIFIER is ON (default), identifiers can be delimited by double quotation marks (" "), and literals must be delimited by single quotation marks (' '). To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
