QUOTENAME
string transform
What changes
- Input
- string arguments
- Output or change
- string or integer
- Return type
- nvarchar(258)
Syntax at a glance
QUOTENAME ( 'character_string' [ , 'quote_character' ] )
Work example
Quote a database identifier when building carefully controlled dynamic SQL.
Keep values parameterized with sp_executesql and use QUOTENAME only for validated identifiers.
Check your work QUOTENAME protects identifier delimiters but does not make arbitrary SQL text safe.
Practice SQL
Open in SQL FlowSELECT QUOTENAME('Order Detail') AS quoted_identifier;
Open Microsoft Learn for full syntax, permissions, and details for your version.