ScriptingOptions Constructor ()


Initializes a new instance of the ScriptingOptions class.

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

public ScriptingOptions()

The default constructor initializes any fields to their default values.

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


$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
Return to top