Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize


Returns a Unicode string with the delimiters added to make the input string a valid Microsoft SQL Server 2005 delimited identifier.

Topic link icon Transact-SQL Syntax Conventions

QUOTENAME ( 'character_string' [ , 'quote_character' ] ) 

' character_string '

Is a string of Unicode character data. character_string is sysname.

' quote_character '

Is a one-character string to use as the delimiter. Can be a single quotation mark ( ' ), a left or right bracket ( [ ] ), or a double quotation mark ( " ). If quote_character is not specified, brackets are used.


The following example takes the character string abc[]def and uses the [ and ] characters to create a valid SQL Server delimited identifier.


Here is the result set.


(1 row(s) affected)

Notice that the right bracket in the string abc[]def is doubled to indicate an escape character.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft