Convert​From-​Encoded​Sql​Name

Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths.

Syntax

ConvertFrom-EncodedSqlName
           [-SqlName] <String>
           [-InformationAction <ActionPreference>]
           [-InformationVariable <String>]
           [<CommonParameters>]

Description

The ConvertFrom-EncodedSqlName cmdlet returns the un-encoded SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths. SQL Server delimited identifiers can contain special characters not normally supported in Windows PowerShell object names. 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 is in the format %nn. Decode-SqlName converts the following encodings to the corresponding characters: %5C-\ %3A-: %2E-. %2F-/ %25-% %3C-< %3E-> %2A-* %3F-? %5B-[ %5D-] %7C-|

Examples

Example 1: Decode a SQL Server identifier

PS C:\> ConvertFrom-EncodedSqlName -SqlName "My%3ATable`/" "My:Table/"

This command decodes a SQL Server identifier that has an encoded hexadecimal representation for the : character. Windows PowerShell also removes the escaping back-tick character (`) from an escaped / character.

Required Parameters

-SqlName

Specifies the SQL Server identifier that this cmdlet reformats.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

String