Condividi tramite


ConvertTo-EncodedSqlName

Encodes extended characters in SQL Server names to formats usable in Windows PowerShell paths.

Sintassi

Default (impostazione predefinita).

ConvertTo-EncodedSqlName
    [-SqlName] <String>
    [<CommonParameters>]

Descrizione

The ConvertTo-EncodedSqlName cmdlet encodes special characters in SQL Server names to formats usable in Windows PowerShell paths.

SQL Server delimited identifiers can contain characters not normally supported in Windows PowerShell object names.

When using delimited identifiers in SQL Server provider paths, these extended characters must be either encoded to their hexadecimal representation or escaped using the ` character.

Certain characters, such as the colon character (:) cannot be escaped.

The hexadecimal encoding for the characters is in the format %nn.

The characters encoded by ConvertTo-EncodedSqlName are: \ : . / % < > * ? [ ] |

Esempio

Example 1: Encode a SQL Server table name

PS C:\> ConvertTo-EncodedSqlName -SqlName "My:Table/"

My%3ATable%2F

This command encodes a SQL Server table name that contains : and / characters.

Parametri

-SqlName

Specifies the SQL Server identifier to be encoded.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:1
Obbligatorio:True
Valore dalla pipeline:True
Valore dalla pipeline in base al nome della proprietà:True
Valore dagli argomenti rimanenti:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Input

String

Output

String