SQL Server QUOTENAME() Function
Example
Return a Unicode string with bracket delimiters (default):
SELECT QUOTENAME('abcdef');
Try it Yourself »
Definition and Usage
The QUOTENAME() function returns a Unicode string with delimiters added to make the string a valid SQL Server delimited identifier.
Syntax
QUOTENAME(string, quote_char)
Parameter Values
Parameter | Description |
---|---|
string | Required. A string of Unicode character data. Limited to 128 characters |
quote_char | Optional. A one-character string to use as the delimiter. Can be a single quotation mark ( ' ), a left or right bracket ( [] ), a double quotation mark ( " ), a left or right parenthesis ( () ), a greater than or less than sign ( >< ), a left or right brace ( {} ) or a backtick ( ` ). If quote_char is not specified, brackets are used. |
Technical Details
Works in: | SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
---|
More Examples
Example
Return a Unicode string with parenthesis delimiters:
SELECT QUOTENAME('abcdef', '()');
Try it Yourself »