Object Scripting Constants (SQLDMO_SCRIPT_TYPE)

SQL-DMO

SQL-DMO

Object Scripting Constants (SQLDMO_SCRIPT_TYPE)

Object scripting constants are used by objects and methods that generate a Transact-SQL script as part of an administrative task automated using SQL-DMO. For example, object scripting constants are used to control the behavior of the:

  • Script method of objects that reference Microsoft® SQL Server™ database objects, agent, and replication components.

  • Transfer object when using the transfer object to copy database objects and agent components.

  • ScriptDestinationObject method of article objects that define replicated data.

Object scripting constants are used in the context established by the object or method. For more information about object scripting constant context, see the reference for the object or method.

Constant Value Description
SQLDMOScript_Aliases 16384 Obsolete.
SQLDMOScript_AppendToFile 256 Object Script method only. Append to indicated output file. By default, Script method overwrites existing file.
SQLDMOScript_Bindings 128 Generate sp_bindefault and sp_bindrule statements. Applies only when scripting references a SQL Server table.
SQLDMOScript_ClusteredIndexes 8 Generate Transact-SQL defining clustered indexes. Applies only when scripting references a SQL Server table or view.
SQLDMOScript_DatabasePermissions 32 Generate Transact-SQL database privilege defining script. Database permissions grant or deny  statement execution rights.
SQLDMOScript_Default 4 SQLDMOScript_PrimaryObj
SQLDMOScript_DRI_All 532676608 All values defined as SQLDMOScript_DRI_... combined using an OR logical operator.
SQLDMOScript_DRI_AllConstraints 520093696 SQLDMOScript_DRI_Checks, SQLDMOScript_DRI_Defaults, SQLDMOScript_DRI_ForeignKeys, SQLDMOScript_DRI_PrimaryKey, and SQLDMOScript_DRI_UniqueKeys combined using an OR logical operator.
SQLDMOScript_DRI_AllKeys 469762048 SQLDMOScript_DRI_ForeignKeys, SQLDMOScript_DRI_PrimaryKey, SQLDMOScript_DRI_UniqueKeys combined using an OR logical operator.
SQLDMOScript_DRI_Checks 16777216 Generated script creates column-specified CHECK constraints. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_Clustered 8388608 Generated script creates clustered indexes. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_Defaults 33554432 Generated script includes column-specified defaults. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_ForeignKeys 134217728 Generated script creates FOREIGN KEY constraints. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_NonClustered 4194304 Generated script creates nonclustered indexes. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_PrimaryKey 268435456 Generated script creates PRIMARY KEY constraints. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRI_UniqueKeys 67108864 Generated script creates candidate keys defined using a unique index. Directs scripting when declarative referential integrity establishes dependency relationships. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRIIndexes 65536 When SQLDMOScript_NoDRI is specified, script PRIMARY KEY constraints using a unique index to implement the declarative referential integrity. Applies only when scripting references a SQL Server table.
SQLDMOScript_DRIWithNoCheck 536870912 When using SQLDMOScript_DRI_Checks, or SQLDMOScript_DRI_ForeignKeys, generated script includes the WITH NOCHECK clause optimizing constraint creation. Applies only when scripting references a SQL Server table.
SQLDMOScript_Drops 1 Generate Transact-SQL to remove the referenced component. Script tests for existence prior attempt to remove component.
SQLDMOScript_IncludeHeaders 131072 Generated script is prefixed with a header containing date and time of generation and other descriptive information.
SQLDMOScript_IncludeIfNotExists 4096 Transact-SQL creating a component is prefixed by a check for existence. When script is executed, component is created only when a copy of the named component does not exist.
SQLDMOScript_Indexes 73736 SQLDMOScript_ClusteredIndexes, SQLDMOScript_NonClusteredIndexes, and SQLDMOScript_DRIIndexes combined using an OR logical operator. Applies to both table and view objects.
SQLDMOScript_NoCommandTerm 32768 Individual Transact-SQL statements in the script are not delimited using the connection-specific command terminator. By default, individual Transact-SQL statements are delimited.
SQLDMOScript_NoDRI 512 Generated Transact-SQL statements do not include any clauses defining declarative referential integrity constraints. Applies only when scripting references a SQL Server table. Only use when script will execute on an instance of SQL Server version 4.21.
SQLDMOScript_NoIdentity 1073741824 Generated Transact-SQL statements do not include definition of identity property, seed, and increment. Applies only when scripting references a SQL Server table.
SQLDMOScript_NonClusteredIndexes 8192 Generate Transact-SQL defining nonclustered indexes. Applies only when scripting references a SQL Server table or view.
SQLDMOScript_None 0 Obsolete.
SQLDMOScript_ObjectPermissions 2 Include Transact-SQL privilege defining statements when scripting database objects.
SQLDMOScript_OwnerQualify 262144 Object names in Transact-SQL generated to remove an object are qualified by the owner of the referenced object. Transact-SQL generated to create the referenced object qualify the object name using the current object owner.
SQLDMOScript_Permissions 34 SQLDMOScript_ObjectPermissions and SQLDMOScript_DatabasePermissions combined using an OR logical operator.
SQLDMOScript_PrimaryObject 4 Generate Transact-SQL creating the referenced component.
SQLDMOScript_SortedData 1048576 Obsolete.
SQLDMOScript_SortedDataReorg 2097152 Obsolete.
SQLDMOScript_TimestampToBinary 524288 When scripting object creation for a table or user-defined data type, convert specification of timestamp data type to binary(8).
SQLDMOScript_ToFileOnly 64 Most SQL-DMO object scripting methods specify both a return value and an optional output file. When used, and an output file is specified, the method does not return the script to the caller, but only writes the script to the output file.
SQLDMOScript_TransferDefault 422143 Default. SQLDMOScript_PrimaryObject, SQLDMOScript_Drops,SQLDMOScript_Bindings, SQLDMOScript_ClusteredIndexes, SQLDMOScript_NonClusteredIndexes, SQLDMOScript_Triggers, SQLDMOScript_ToFileOnly, SQLDMOScript_Permissions, SQLDMOScript_IncludeHeaders, SQLDMOScript_Aliases, SQLDMOScript_IncludeIfNotExists, and SQLDMOScript_OwnerQualify combined using an OR logical operator.
SQLDMOScript_Triggers 16 Generate Transact-SQL defining triggers. Applies only when scripting references a SQL Server table or view.
SQLDMOScript_UDDTsToBaseType 1024 Convert specification of user-defined data types to the appropriate SQL Server base data type. Applies only when scripting references a SQL Server table.
SQLDMOScript_UseQuotedIdentifiers -1 Use quote characters to delimit identifier parts when scripting object names.

See Also

Object Scripting Constants (SQLDMO_SCRIPT2_TYPE)

Script Method

Script Method (BackupDevice Object)

Script Method (Table Object)

ScriptType Property

ScriptDestinationObject Method