ScriptingOptions.Subtraction Operator (ScriptingOptions, ScriptOption)

 

Creates a set of scripting options by performing an subtraction operation on a ScriptingOptions object and a ScriptOption object.

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

public static ScriptingOptions operator -(
	ScriptingOptions options,
	ScriptOption scriptOption
)

Parameters

options
Type: Microsoft.SqlServer.Management.Smo.ScriptingOptions

A ScriptingOptions object that specifies the scripting options.

scriptOption
Type: Microsoft.SqlServer.Management.Smo.ScriptOption

A ScriptOption object that specifies the script option to be subtracted from the options specified by the options parameter..

Return Value

Type: Microsoft.SqlServer.Management.Smo.ScriptingOptions

A ScriptingOptions object value that specifies a set of scripting options after the subtraction.

The following code example creates a new set of script options by subtracting a ScriptOption value from an existing ScriptingOptions object.

PowerShell

$scOps = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions
$scOps.NoXmlNamespaces = $TRUE
$scOps.Permissions = $TRUE
$scOps2 = [Microsoft.SqlServer.Management.Smo.ScriptingOptions]::op_Subtraction($scOps, [Microsoft.SqlServer.Management.Smo.ScriptOption]::Permissions)
Return to top
Show: