Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

QUOTENAME

Example

Return a Unicode string enclosed in bracket delimiters by default.

SELECT QUOTENAME(‘abcdef’);

Definition and Usage

The QUOTENAME() function returns a Unicode string with delimiters added to ensure the string is formatted as a valid SQL Server delimited identifier.

Syntax

QUOTENAME(string, quote_char)

Parameter Values

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.

Technical Details

Works in:

 SQL Server (since 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse.

More Examples

Example

Return a Unicode string enclosed in parenthesis as delimiters.

SELECT QUOTENAME(‘abcdef’‘()’);