ScriptingOptions.Encoding 属性

Gets or sets the encoding for the scripting options.

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public Property Encoding As Encoding 
    Get 
    Set
用法
Dim instance As ScriptingOptions 
Dim value As Encoding 

value = instance.Encoding

instance.Encoding = value
public Encoding Encoding { get; set; }
public:
property Encoding^ Encoding {
    Encoding^ get ();
    void set (Encoding^ value);
}
member Encoding : Encoding with get, set
function get Encoding () : Encoding 
function set Encoding (value : Encoding)

属性值

类型:System.Text.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

PowerShell

$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

请参阅

参考

ScriptingOptions 类

Microsoft.SqlServer.Management.Smo 命名空间

其他资源

脚本撰写