ScriptingOptions 构造函数

Initializes a new instance of the ScriptingOptions class.

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

语法

声明
Public Sub New
用法
Dim instance As New ScriptingOptions()
public ScriptingOptions()
public:
ScriptingOptions()
new : unit -> ScriptingOptions
public function ScriptingOptions()

注释

默认构造函数将所有字段初始化为其默认值。

示例

The following code example creates a new instance of the ScriptingOptions class and uses it to configure a Scripter.

Visual Basic

Dim srv As Server
srv = New Server
Dim scriptingOptions As ScriptingOptions
scriptingOptions = New ScriptingOptions
scriptingOptions.ScriptDrops = false
scriptingOptions.WithDependencies = true
Dim scrp As Scripter
scrp = New Scripter(srv)
scrp.Options = scriptingOptions

PowerShell

$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$scriptingOptions = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions
$scriptingOptions.ScriptDrops = $FALSE
$scriptingOptions.WithDependencies = $TRUE
$scrp = New-Object Microsoft.SqlServer.Management.Smo.Scripter($srv)
$scrp.Options = $scriptingOptions

请参阅

参考

ScriptingOptions 类

ScriptingOptions 重载

Microsoft.SqlServer.Management.Smo 命名空间

其他资源

脚本撰写