bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server QUOTENAME() Function

Concept visual

SQL Server QUOTENAME() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return a Unicode string with bracket delimiters (default):

SELECT QUOTENAME('abcdef');

Definition and Usage

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

Syntax

Quotename(

string, quote_char )

Parameter Values

Parameter

Description string

Required. A string of Unicode character data. Limited to 128 characters quote_char

Optional. A one-character string to use as the delimiter. 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 quote_char is not specified, brackets are used.

Technical Details

Works in:

SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

More Examples

Example

Return a Unicode string with parenthesis delimiters:

SELECT QUOTENAME('abcdef', '()');

Previous

❮ SQL Server Functions

Next

Previous

SQL Server PATINDEX() Function

Next

SQL Server REPLACE() Function