QUOTENAME (języka Transact-SQL)

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

Topic link iconKonwencje składni języka Transact-SQL

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

Argumenty

  • 'character_string'
    Is a string of Unicode character data.character_string is sysname and is limited to 128 characters.Dane wejściowe jest większa niż 128 znaków zwraca wartość NULL.

  • 'quote_character'
    Jest ciągiem o jeden znak używany jako ogranicznik.Can be a single quotation mark ( ' ), a left or right bracket ( [] ), or a double quotation mark ( " ).Jeśli quote_character nie jest określony, użyte są nawiasy.

Zwracane typy

nvarchar(258)

Przykłady

Poniższy przykład pobiera ciąg znaków abc[]def i używa [ i ] znaki do utworzenia prawidłowego SQL Server identyfikator z ogranicznikami.

SELECT QUOTENAME('abc[]def')

Here is the result set.

[abc[]]def]

(1 row(s) affected)

Należy zauważyć, że po prawej stronie — nawias w ciąg abc[]def jest podwajany, aby określić znak anulowania.