ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
2 out of 70 rated this helpful - Rate this topic

QUOTENAME

SQL Server 2000

Returns a Unicode string with the delimiters added to make the input string a valid Microsoft® SQL Server™ delimited identifier.

Syntax

QUOTENAME ( 'character_string' [ , 'quote_character' ] )

Arguments

'character_string'

Is a string of Unicode character data. character_string is sysname.

'quote_character'

Is a one-character string to use as the delimiter. Can be a single quotation mark ('), a left or right bracket ([]), or a double quotation mark ("). If quote_character is not specified, brackets are used.

Return Types

nvarchar(258)

Examples

This example takes the character string abc[]def and uses the [ and ] characters to create a valid SQL Server quoted (delimited) identifier.

SELECT QUOTENAME('abc[]def')

Here is the result set:

[abc[]]def]

(1 row(s) affected)

Notice that the right bracket in the string abc[]def is doubled to indicate an escape character.

See Also

String Functions

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.