Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

ScriptingOptions.Encoding Property

Gets or sets the encoding for the scripting options.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public Encoding Encoding { get; set; }

Property Value

Type: Encoding
An Encoding object that specifies the encoding for the scripting options

The following code example specifies that the script will use UTF8 encoding.

Visual Basic

Dim srv As New Server("(local)")
Dim scrp As New ScriptingOptions(srv)
Dim sEnc As Encoding = Encoding.UTF8
scrp.Encoding = sEnc


$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$scrp = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions($srv)
$sEnc = System.Text.Encoding.UTF8
$scrp.Encoding = $sEnc
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft