ScriptingOptions.EnforceScriptingOptions ScriptingOptions.EnforceScriptingOptions ScriptingOptions.EnforceScriptingOptions Property

Definition

Gets or sets the Boolean property value that specifies whether the application of all scripting options is enforced for text-based objects, such as SchemaQualify.

public:
 property bool EnforceScriptingOptions { bool get(); void set(bool value); };
public bool EnforceScriptingOptions { get; set; }
Public Property EnforceScriptingOptions As Boolean
Property Value

A Boolean value that specifies whether the application of all scripting options is enforced for text-based objects.

If True, the application of all scripting options is enforced for text-based objects.

If False (default), object text is scripted without any modification.

Examples

The following code example specifies that the application of scripting options will be enforced for text-based objects.

Visual Basic

Dim scOps As New ScriptingOptions()  
scOps.EnforceScriptingOptions = true  

PowerShell

$scOps = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions  
$scOps.EnforceScriptingOptions = $TRUE  

Remarks

Text-based objects will lose any comments and formatting, because the object will be constructed based on metadata.

Applies to