SQL QUOTENAME Function

The SQL QUOTENAME is one of the String Function, which will return the Unicode string by adding a delimiter to it. The basic syntax of the SQL Server QUOTENAME function is:

SELECT QUOTENAME(String_Expression, delimiter)

The list of arguments available for this string QUOTENAME 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 : [, ], {, }, (, ), “, ‘,  >, <, `.

SQL QUOTENAME Example

The following String Function query will return the Unicode strings with the specified delimiters using Quotename function.

-- SQL Server QUOTENAME Example

SELECT QUOTENAME('abc{}def');  

SELECT QUOTENAME('abc[]def'); 

SELECT QUOTENAME('abc"def"');  

SELECT QUOTENAME('abc[]def', '(' );  

SELECT QUOTENAME('abc def', '{' );
SQL QUOTENAME Function 1