SnowConvert AI - SQL Server-Azure Synapse - QUOTED_IDENTIFIER¶
Applies to
SQL Server
Azure Synapse Analytics
Description¶
This statement controls whether double quotation marks are used to delimit identifiers (such as table names, column names, etc.) or string literals in SQL Server. When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks, and literals must be delimited by single quotation marks. When OFF, double quotation marks are treated as string literal delimiters. Please visit SET QUOTED_IDENTIFIER to get more information about this statement.
Transact-SQL Syntax¶
Behavior Comparison¶
SQL Server Behavior¶
In SQL Server, the SET QUOTED_IDENTIFIER setting determines how double quotes are interpreted:
When ON (default): Double quotes delimit identifiers, allowing special characters and reserved keywords in object names
When OFF: Double quotes are treated as string literal delimiters (similar to single quotes)
Snowflake Behavior¶
Snowflake always treats double quotes as identifier delimiters (equivalent to SQL Server’s QUOTED_IDENTIFIER ON). There is no equivalent to the OFF setting. Key differences include:
Case Sensitivity:
Unquoted identifiers are automatically converted to uppercase
Quoted identifiers preserve exact case and become case-sensitive
QUOTED_IDENTIFIERS_IGNORE_CASE Parameter: Controls case sensitivity for quoted identifiers
Sample Source Patterns¶
SET QUOTED_IDENTIFIER ON¶
When QUOTED_IDENTIFIER is ON in SQL Server, double quotes can be used to delimit identifiers containing spaces or special characters.
SQL Server¶
Snowflake¶
Example of the Difference
Let’s assume you’ve migrated a table from a SQL Server database with a case-insensitive collation (_CI):
SQL Server (with _CI collation):¶
In this case, the _CI collation makes the two SELECT statements interchangeable.
Snowflake:¶
The Snowflake behavior is different because it respects the case of the quoted identifier by default. It could be approachable by altering the session using.
If you want to set the parameter at the account level, you can use the following command:
This will set the parameter for all sessions associated with the account. For further information, check the following documentation;
SET QUOTED_IDENTIFIER OFF¶
When QUOTED_IDENTIFIER is OFF in SQL Server, double quotes are treated as string delimiters.
SQL Server¶
Snowflake¶
Migration Considerations¶
Review Identifier Casing: Ensure consistent casing when migrating to Snowflake, especially for quoted identifiers
String Literals: Replace double-quoted string literals with single-quoted literals
Use QUOTED_IDENTIFIERS_IGNORE_CASE: Consider setting this parameter to
TRUEearly in migration to reduce case sensitivity issuesTest Thoroughly: Verify all object references work correctly after migration