Quoted strings in column headings

You can include any characters—including blanks—in a column heading if you enclose the entire heading in quotation marks. You need not set the quoted_identifier option on. If the column heading is not enclosed in quotation marks, it must conform to the rules for identifiers. Both of these queries produce the same result:

select "Publisher's Name" = pub_name from publishers
select pub_name "Publisher's Name" from publishers
Publisher’s Name 
---------------- 
New Age Books 
Binnet & Hardley 
Algodata Infosystems
 
(3 rows affected)

You can also use Transact-SQL reserved words in quoted column headings. For example, the following query, using the reserved word sum as a column heading, is valid:

select "sum" = sum(total_sales) from titles

Quoted column headings cannot be more than 255 bytes long.

NoteBefore using quotes around a column name in a create table, alter table, select into, or create view statement, you must set quoted_identifier on.