T-SQL QUOTENAME() Function
The T-SQL (Transact-SQL) QUOTENAME() function returns a Unicode string with the delimiters added to make the input string a valid SQL Server delimited identifier.
Syntax
QUOTENAME('character_string' [ , 'quote_character' ])
Parameters
character_string |
Required. Specify a string of Unicode character data. It should be limited to 128 characters. If it is greater than 128 characters then the function returns NULL. |
quote_character |
|
Return Value
Returns a Unicode string with the delimiters added.
Example 1:
The example below shows the usage of QUOTENAME() function.
SELECT QUOTENAME('abc def'); Result: [abc def] SELECT QUOTENAME('abcdef', '()'); Result: (abcdef) SELECT QUOTENAME('abc[]def'); Result: [abc[]]def]
❮ T-SQL Functions