Script2Type Property
The ScriptType and Script2Type properties configure the Transact-SQL script generated and used to copy database schema in a transfer of schema from one database to another.
Applies To
Transfer Object | Transfer2 Object |
Syntax
object.Script2Type [= value]
Parts
object
Expression that evaluates to an object in the Applies To list
value
Long integer that specifies script generation options as described in Settings
Data Type
Long, enumerated
Modifiable
Read/write
Prototype (C/C++)
HRESULT GetScript2Type(SQLDMO_SCRIPT2_TYPE* pRetVal);
HRESULT SetScript2Type(SQLDMO_SCRIPT2_TYPE NewValue);
Settings
Constant | Value | Description |
---|---|---|
SQLDMOScript2_70Only | 16777216 | Disable features available in instances of SQL Server 2000 so that output is compatible with an instance of SQL Server version 7.0. Disabled features are:
Column-level collation |
SQLDMOScript2_AgentAlertJob | 2048 | Generate Transact-SQL script creating Microsoft® SQL Server™ Agent jobs and alerts. |
SQLDMOScript2_AgentNotify | 1024 | When scripting an alert, generate script creating notifications for the alert. |
SQLDMOScript2_AnsiFile | 2 | Generated script file uses multibyte characters. Code page 1252 is used to determine character meaning. |
SQLDMOScript2_AnsiPadding | 1 | Generate Transact-SQL SET ANSI_PADDING ON and SET ANSI_PADDDING OFF statements before and after CREATE TABLE statements in the generated script. Applies only when scripting references a SQL Server table. |
SQLDMOScript2_Default | 0 | No scripting options specified. |
SQLDMOScript2_EncryptPWD | 128 | Encrypt passwords with script. When specified, SQLDMOScript2_UnicodeFile must be specified as well. |
SQLDMOScript2_ExtendedOnly | 67108864 | Ignore all SQLDMO_SCRIPT_TYPE settings. Use to script extended property settings only. Script may require editing prior to running on destination database. |
SQLDMOScript2_ExtendedProperty | 4194304 | Include extended property scripting as part of object scripting. |
SQLDMOScript2_FullTextCat | 2097152 | Command batch includes Transact-SQL statements creating Microsoft Search full-text catalogs. |
SQLDMOScript2_FullTextIndex | 524288 | Generated script includes statements defining Microsoft Search full-text indexing. Applies only when scripting references a SQL Server table. Include security identifiers for logons scripted. |
SQLDMOScript2_JobDisable | 33554432 | Disable the job at the end of script creation. SQLDMOScript2_PrimaryObject must also be specified. |
SQLDMOScript2_LoginSID | 8192 | Include security identifiers for logins scripted. |
SQLDMOScript2_NoCollation | 8388608 | Do not script the collation clause if source is an instance of SQL Server version 7.0 or later. The default is to generate collation. |
SQLDMOScript2_NoFG | 16 | Generated script does not include 'ON <filegroup>' clause directing filegroup use. Applies only when scripting references a SQL Server table. |
SQLDMOScript2_NoWhatIfIndexes | 512 | Do not script hypothetical indexes used to implement the CREATE STATISTICS statement. Applies only when scripting references a SQL Server table. |
SQLDMOScript2_UnicodeFile | 4 | Generated script output file is a Unicode-character text file. |
Remarks
Use the AddObject and AddObjectByName methods of the Transfer object to build a list of SQL Server components copied from one database to another. With the list built, configure component transfer using the ScriptType and Script2Type properties.