The ScriptingOptions object provides programmatic options to the options that can be set for scripting operations.
The following tables list the members exposed by the ScriptingOptions type.
Public Constructors
| 名称 | Description | |
|---|---|---|
| ScriptingOptions | Overloaded. Initializes a new instance of the ScriptingOptions class. | 
顶部
Public Properties
| 名称 | Description | |
|---|---|---|
| .gif) | AgentAlertJob | Gets or sets the Boolean property that specifies whether to include SQL Server Agent job name for alert objects in the script. | 
| .gif) | AgentJobId | Gets or sets the Boolean property that specifies whether to include SQL Server Agent job ID values for alert objects in the script. | 
| .gif) | AgentNotify | Gets or sets the Boolean property that specifies whether to include notifications for any SQL Server Agent alerts that in the script. | 
| .gif) | AllowSystemObjects | Gets or sets the Boolean property that specifies whether system objects can be scripted or not. | 
| .gif) | AnsiFile | Gets or sets the Boolean property that specifies whether the script uses multibyte characters and requires code page 1252 to evaluate characters meaning. | 
| .gif) | AnsiPadding | Gets or sets a Boolean property that specifies whether the generated script contains the Transact-SQL statements SET ANSI-PADDING ON and SET ANSI-PADDING OFF before and after the CREATE TABLE statement respectively. | 
| .gif) | AppendToFile | Gets or sets a Boolean property value that specifies whether the script is appended to the end of the output file or overwrites it. | 
| .gif) | Bindings | Gets or sets a Boolean property value that specifies whether the binding statements sp_binddefault and sp_bindrule are included in the generated script. This property applies only when scripting a Microsoft SQL Server table. | 
| .gif) | ClusteredIndexes | Gets or sets a Boolean property value that specifies whether statements that define clustered indexes are included in the generated script. | 
| .gif) | ContinueScriptingOnError | Gets or sets the Boolean property value that specifies whether the scripting operation continues after an error is encountered. | 
| .gif) | ConvertUserDefinedDataTypesToBaseType | Gets or sets the Boolean property value that specifies whether user-defined data types are converted to the most appropriate Microsoft SQL Server base data types in the generated script. | 
| .gif) | DdlBodyOnly | Gets or sets the Boolean property value that specifies whether to script only the text definition for data definition language (DDL) objects that have a text body, such as stored procedures and triggers. | 
| .gif) | DdlHeaderOnly | Gets or sets the Boolean property value that specifies whether to script only the header information for data definition language (DDL) objects that have a text body, such as stored procedures and triggers. | 
| .gif) | Default | Gets or sets the Boolean property value that specifies whether the creation of the referenced object is included in the generated script. | 
| .gif) | DriAll | Gets or sets the Boolean property value that specifies whether all DRI objects are included in the generated script. | 
| .gif) | DriAllConstraints | Gets or sets the Boolean property value that specifies whether all DRI constraints are included in the generated script. | 
| .gif) | DriAllKeys | Gets or sets the Boolean property value that specifies whether the dependency relationships defined by all DRI keys are included in the generated script. | 
| .gif) | DriChecks | Gets or sets the Boolean property value that specifies whether column specific dependency relationships defined in check constraints with enforced declarative referential integrity are included in the script. | 
| .gif) | DriClustered | Gets or sets the Boolean property value that specifies whether dependency relationships defined in clustered indexes with enforced declarative referential integrity are included in the script. | 
| .gif) | DriDefaults | Gets or sets the Boolean property value that specifies whether dependency relationships defined in defaults with enforced declarative referential integrity are included in the script. | 
| .gif) | DriForeignKeys | Gets or sets the Boolean property value that specifies whether dependency relationships defined in foreign keys with enforced declarative referential integrity are included in the script. | 
| .gif) | DriIncludeSystemNames | Gets or sets the Boolean property value that specifies whether the system generated constraint names used to enforce declarative referential integrity are included in the script. | 
| .gif) | DriIndexes | Gets or sets the Boolean property value that specifies whether PRIMARY KEY constraints using a unique index to implement the declarative referential integrity are included in the script. | 
| .gif) | DriNonClustered | Gets or sets the Boolean property value that specifies whether dependency relationships defined in non-clustered indexes with enforced declarative referential integrity are included in the script. | 
| .gif) | DriPrimaryKey | Gets or sets the Boolean property value that specifies whether dependency relationships defined in primary keys with enforced declarative referential integrity are included in the script. | 
| .gif) | DriUniqueKeys | Gets or sets the Boolean property value that specifies whether dependency relationships defined in unique keys with enforced declarative referential integrity are included in the script. | 
| .gif) | DriWithNoCheck | Gets or sets the Boolean property value that specifies whether the no check statement is included in the script. | 
| .gif) | Encoding | Gets or sets the encoding for the scripting options. | 
| .gif) | EnforceScriptingOptions | 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. | 
| .gif) | ExtendedProperties | Gets or sets the Boolean property value that specifies whether extended object properties are included in the generated script. | 
| .gif) | FileName | Gets or sets the name of the file to which the generated script is output. | 
| .gif) | FullTextCatalogs | Gets or sets the Boolean property value that specifies whether full-text catalogs are included in the generated script. | 
| .gif) | FullTextIndexes | Gets or sets the Boolean property value that specifies whether full-text indexes are included in the generated script. | 
| .gif) | IncludeDatabaseContext | Gets or sets the Boolean property value that specifies whether the database context is included in the generated script. | 
| .gif) | IncludeHeaders | Gets or sets a Boolean property value that specifies whether the generated script is prefixed with a header containing information including the date and time of generation. | 
| .gif) | IncludeIfNotExists | Gets or sets a Boolean property value that specifies whether to check the existence of an object before including it in the script. | 
| .gif) | Indexes | Gets or sets the Boolean property value that specifies whether indexes are included in the generated script. | 
| .gif) | LoginSid | Gets or sets the Boolean property value that specifies whether the security identifiers are included for any scripted logins in the generated script. | 
| .gif) | NoAssemblies | Gets or sets the Boolean property value that specifies whether assemblies are included in the generated script. | 
| .gif) | NoCollation | Gets or sets the Boolean property value that specifies whether to include the collection in the generated script if the server is running SQL Server 7.0 or later. | 
| .gif) | NoCommandTerminator | Gets or sets the Boolean property value that specifies whether individual Transact-SQL statements are delimited in the generated script. | 
| .gif) | NoExecuteAs | Gets or sets the Boolean property value that specifies whether the EXECUTE AS options for stored procedures and user-defined functions are included in the script. | 
| .gif) | NoFileGroup | Gets or sets the Boolean property value that specifies whether to include the 'ON <filegroup>' clause in the generated script. | 
| .gif) | NoIdentities | Gets or sets the Boolean property value that specifies whether definitions of identity property seed and increment are included in the generated script. | 
| .gif) | NoIndexPartitioningSchemes | Gets or sets the Boolean property value that specifies whether partition schemes for indexes are included in the generated script. | 
| .gif) | NoMailProfileAccounts | Gets or sets the Boolean property value that specifies whether mail accounts referenced by mail profiles are included in the generated script. | 
| .gif) | NoMailProfilePrincipals | Gets or sets the Boolean property value that specifies whether principals referenced by mail profiles are included in the generated script. | 
| .gif) | NonClusteredIndexes | Gets or sets the Boolean property value that specifies whether non-clustered indexes are included in the generated script. | 
| .gif) | NoTablePartitioningSchemes | Gets or sets the Boolean property value that specifies whether partition schemes for tables are included in the generated script. | 
| .gif) | NoViewColumns | Gets or sets the Boolean property value that specifies whether to include the specified columns for a view. | 
| .gif) | NoXmlNamespaces | Gets or sets the Boolean property value that specifies whether XML namespaces are included in the generated script. | 
| .gif) | OptimizerData | Gets or sets the Boolean property value that specifies whether script optimizer data for the referenced objects are included in the generated script. | 
| .gif) | Permissions | Gets or sets the Boolean property value that specifies whether to all permissions in the generated script. | 
| .gif) | PrimaryObject | Gets or sets the Boolean property value that specifies whether the creation of the referenced object is included in the generated script. | 
| .gif) | SchemaQualify | Gets or sets the Boolean property value that specifies whether objects with no schema are included in the generated script. | 
| .gif) | SchemaQualifyForeignKeysReferences | Gets or sets the Boolean property value that specifies whether schema qualify table references for foreign key constraints are included in the generated script. | 
| .gif) | ScriptDrops | Gets or sets the Boolean property value that specifies whether the script operation generates a Transact-SQL script to remove the referenced component. | 
| .gif) | Statistics | Gets or sets the Boolean property value that specifies whether statistics for any table or view that is included in the generated script. | 
| .gif) | TargetServerVersion | Gets or sets the version of the instance of SQL Server for which the generated script is intended. | 
| .gif) | TimestampToBinary | Gets or sets the Boolean property value that specifies whether to convert timestamp data types to a binary(8) data types when scripting the creation of a table or user defined data type. | 
| .gif) | ToFileOnly | Gets or sets the Boolean property value that specifies whether to output to file only or to generate string output also. | 
| .gif) | Triggers | Gets or sets the Boolean property value that specifies whether to include the definition for triggers in the generated script. | 
| .gif) | WithDependencies | Gets or sets the Boolean property value that specifies whether to include all dependent objects in the generated script. | 
| .gif) | XmlIndexes | Gets or sets the Boolean property value that specifies whether XML indexes are included in the generated script. | 
顶部
Public Methods
(see also Protected Methods )
| 名称 | Description | |
|---|---|---|
| .gif) | Add | Overloaded. | 
| .gif) | Equals | Overloaded. (inherited from Object ) | 
| .gif) | GetHashCode | (inherited from Object ) | 
| .gif) | GetType | (inherited from Object ) | 
| .gif) .gif) | op_Addition | Creates a set of scripting options by performing an addition operation on a ScriptingOptions object and a ScriptOption object. | 
| .gif) .gif) | op_Subtraction | Creates a set of scripting options by performing an subtraction operation on a ScriptingOptions object and a ScriptOption object. | 
| .gif) .gif) | ReferenceEquals | (inherited from Object ) | 
| .gif) | Remove | Removes a ScriptOption object from the ScriptingOptions object. | 
| .gif) | SetTargetServerVersion | Sets the version of the instance of SQL Server on which the scripting operation is run. | 
| .gif) .gif) | Subtract | |
| .gif) | ToString | Overridden. Returns a string that represents the ScriptingOptions object. | 
顶部
Protected Methods
| 名称 | Description | |
|---|---|---|
| .gif) | Finalize | (inherited from Object ) | 
| .gif) | MemberwiseClone | (inherited from Object ) | 
顶部
请参阅
参考
ScriptingOptions Class
Microsoft.SqlServer.Management.Smo Namespace
其他资源
How to: Script Out the Dependencies for a Database in Visual Basic .NET
Scripting