I have seen some people alias column names using single quotes eg:
select orderID \'Order No\' from orders
and others use square brackets e
It depends on what settings you have in force whether '
s are valid or not. And you missed out "
. See Delimited Identifiers:
When QUOTED_IDENTIFIER is set to ON, SQL Server follows the ISO rules for the use of double quotation marks (")and the single quotation mark (') in SQL statements. For example:
Double quotation marks can be used only to delimit identifiers. They cannot be used to delimit character strings.
Single quotation marks must be used to enclose character strings. They cannot be used to delimit identifiers.
When QUOTED_IDENTIFIER is set to OFF, SQL Server uses the following rules for single and double quotation marks:
Quotation marks cannot be used to delimit identifiers. Instead, brackets have to be used as delimiters.
Single or double quotation marks can be used to enclose character strings.
And finally:
Delimiters in brackets can always be used, regardless of the setting of QUOTED_IDENTIFIER
Where, in all of the above quotes, when they refer to brackets they're talking about []
brackets.