Returns a Unicode string with the delimiters added to make the input string a valid Microsoft® SQL Server™ delimited identifier.
QUOTENAME('character_string'[, 'quote_character'])
nvarchar(129)
This example takes the character string abc[]def and uses the [ and ] characters to create a valid SQL Server quoted (delimited) identifier.
SELECT QUOTENAME('abc[]def')
Here is the result set:
[abc[]]def]
(1 row(s) affected)
Notice that the right bracket in the string abc[]def is doubled to indicate an escape character.