devxlogo

Using Quotation Marks in SQL Server

Using Quotation Marks in SQL Server

The standard delimiters for literal strings in SQL are single quotation marks (‘). By default, SQL Server reserves double quotation marks (“) as delimiters for database objects.
The SQL Server ODBC driver supports a Quoted Identifiers setting for the session or connection. If this setting is on, double quotation marks are interpreted as delimiters for identifiers. However, if you turn this setting off, double quotation marks are interpreted instead as delimiters for literal strings.
To avoid ambiguity, the Query Designer always sets Quoted Identifiers on, so that double quotation marks are always interpreted as database object delimiters. If you have previously turned Quoted Identifiers off, the Query Designer overrides your setting.
Therefore, in the Query Designer, always use single quotation marks to enclose string literals. Use double quotation marks only as needed for database objects delimiters.

devx-admin

Share the Post: