共用方式為


ScriptingOptions Class

Definition

Instance class encapsulating SQL Server database

public sealed class ScriptingOptions
type ScriptingOptions = class
Public NotInheritable Class ScriptingOptions
Inheritance
ScriptingOptions

Constructors

ScriptingOptions()

Default constructor. Sets all default options.

ScriptingOptions(ScriptingOptions)

Copy constructor.

ScriptingOptions(ScriptOption)

Creates a ScriptingOptions object with a single option set.

ScriptingOptions(SqlSmoObject)

Constructs a ScriptingOptions object using target settings from the parent object's server

Properties

AgentAlertJob

Whether to include scripting Agent Alert jobs

AgentJobId

Whether to include scripting Agent job id

AgentNotify

Whether to include scripting Agent notifications

AllowSystemObjects

Whether system objects are scripted

AnsiFile

If set will create an ANSI file in which to write the script results.

AnsiPadding

Whether ansi padding scripts are included

AppendToFile

Appends to file instead of overwriting it.

BatchSize

The number of statements after which to script batch terminator

Bindings
ChangeTracking

Whether to include Change Tracking options

ClusteredIndexes
ColumnStoreIndexes
ContinueScriptingOnError

Whether execution should continue on scripting error

ConvertUserDefinedDataTypesToBaseType

Whether user defined data types are converted to base type

DdlBodyOnly
DdlHeaderOnly
Default
DriAll
DriAllConstraints
DriAllKeys
DriChecks
DriClustered
DriDefaults
DriForeignKeys
DriIncludeSystemNames

Whether to include system names for constraints

DriIndexes
DriNonClustered
DriPrimaryKey
DriUniqueKeys
DriWithNoCheck
Encoding
EnforceScriptingOptions
ExtendedProperties

Whether extended properties are scripted

FileName
FullTextCatalogs
FullTextIndexes
FullTextStopLists
IncludeDatabaseContext

Whether use database script are included

IncludeDatabaseRoleMemberships

Whether binding memberships are included

IncludeFullTextCatalogRootPath
IncludeHeaders

Whether a header containing information about the object being scripted (such as name and time scripted ) is included

IncludeIfNotExists

Whether an existence check is added

IncludeScriptingParametersHeader

Whether a header containing information about the scripting parameters is included

Indexes
LoginSid

Whether security identifier (SID) is included

NoAssemblies
NoCollation

Whether collation details are excluded

NoCommandTerminator
NoExecuteAs

Whether to exclude EXECUTE AS statements

NoFileGroup
NoFileStream

Whether to exclude filestream filegroups

NoFileStreamColumn

Whether to include filestream column

NoIdentities

Whether identities are excluded

NoIndexPartitioningSchemes
NoMailProfileAccounts

Whether mail accounts are excluded

NoMailProfilePrincipals

Whether mail account principals are excluded

NonClusteredIndexes
NoTablePartitioningSchemes
NoVardecimal
NoViewColumns
NoXmlNamespaces

Whether XmlNamespaces are included for data types

OptimizerData

Whether to include OptimizerData

Permissions

Whether permissions are included

PrimaryObject
SchemaQualify

Whether object names are schema qualified

SchemaQualifyForeignKeysReferences

Whether referenced table names are schema qualified

ScriptBatchTerminator
ScriptData

Whether data is included

ScriptDataCompression

Whether to include Data Compression options

ScriptDrops

Scripts DROP statemens for the objects.

ScriptForAlter

Scripts ALTER statement for the objects.

ScriptForCreateDrop

Scripts DROP and Create statement for the objects.

ScriptOwner

Whether owner statements are included

ScriptSchema

Whether metadata script are included

SpatialIndexes
Statistics
TargetDatabaseEngineEdition

The server database edition on which the scripts will run.

TargetDatabaseEngineType

The server database engine type on which the scripts will run.

TargetServerVersion

The server version on which the scripts will run.

TimestampToBinary

Whether timestamps are converted to binary

ToFileOnly
Triggers
WithDependencies
XmlIndexes

Methods

Add(ScriptingOptions, ScriptOption)
Add(ScriptOption)
ConvertToSqlServerVersion(Int32, Int32)

Converts a Major and Minor version number pair into the equivalent SqlServerVersion

ConvertToSqlServerVersion(ServerVersion)

Converts a ServerVersion into the equivalent SqlServerVersion value

ConvertVersion(Version)

Method to convert the server version to SqlServerVersion

GetScriptingPreferences()

Returns Scripting Preferences corresponding to the ScriptingOptions

Remove(ScriptOption)
SetTargetDatabaseEngineType(DatabaseEngineType)

Sets the TargetServerDatabasseEngineType based on a DatabaseEngineType structure.

SetTargetServerVersion(ServerVersion)

Sets the TargetServerVersionInternal based on a ServerVersion structure.

Subtract(ScriptingOptions, ScriptOption)
ToString()

Operators

Addition(ScriptingOptions, ScriptOption)
Subtraction(ScriptingOptions, ScriptOption)

Applies to