Return a Unicode string enclosed in bracket delimiters by default.
SELECT QUOTENAME(‘abcdef’); |
The QUOTENAME() function returns a Unicode string with delimiters added to ensure the string is formatted as a valid SQL Server delimited identifier.
QUOTENAME(string, quote_char) |
Parameter |
Description |
string |
Required: A string consisting of Unicode character data, with a maximum length of 128 characters. |
quote_char |
Optional: A single-character string used as the delimiter, which 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 not specified, brackets are used as the default delimiter. |
Works in: |
SQL Server (since 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse. |
Return a Unicode string enclosed in parenthesis as delimiters.
SELECT QUOTENAME(‘abcdef’, ‘()’); |