The SQL Server QUOTENAME is one of the String functions, which will return the Unicode string by adding a delimiter to it. The basic syntax of the QUOTENAME function is:
SELECT QUOTENAME(String_Expression, delimiter)
The list of arguments available for this is:
- String_Expression: Please specify a valid String Expression
- Delimiter: This is an optional SQL Server argument. Use this to specify the delimiter such as : [, ], {, }, (, ), “, ‘, >, <, `. Please refer to the list of SQL String Functions from our SQL Server tutorial.
QUOTENAME Example
The following String method query will return the Unicode strings with the specified delimiters using the Quotename function. Please refer to the SQL REPLACE function.
SELECT QUOTENAME('abc{}def');
SELECT QUOTENAME('abc[]def');
SELECT QUOTENAME('abc"def"');
SELECT QUOTENAME('abc[]def', '(' );
SELECT QUOTENAME('abc def', '{' );
