Script2Type Property

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

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.

Syntax

object.Script2Type [= value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list.

  • value
    A 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

Disables features available in instances of SQL Server 2000 or later so that output is compatible with an instance of SQL Server version 7.0. Disabled features are:

Column-level collation User-defined functionsExtended properties Instead of triggers on tables and views Indexes on views Indexes on computed columns Descending indexes The default value is OFF.

SQLDMOScript2_AgentAlertJob

2048

Generates Transact-SQL script creating SQL Server Agent jobs and alerts.

SQLDMOScript2_AgentNotify

1024

When scripting an alert, generates script creating notifications for the alert.

SQLDMOScript2_AnsiFile

2

The generated script file uses multibyte characters. Code page 1252 is used to determine character meaning.

SQLDMOScript2_AnsiPadding

1

Generates Transact-SQL SET ANSI_PADDING ON and SET ANSI_PADDDING OFF statements before and after CREATE TABLE statements in the generated script. It applies only when scripting references a SQL Server table.

SQLDMOScript2_Default

0

No scripting options are specified.

SQLDMOScript2_EncryptPWD

128

Encrypts passwords with script. If this setting is specified, SQLDMOScript2_UnicodeFile must be specified as well.

SQLDMOScript2_ExtendedOnly

67108864

Ignores all SQLDMO_SCRIPT_TYPE settings. Use to script extended property settings only. The script may require editing before it runs on the destination database.

SQLDMOScript2_/ExtendedProperty

4194304

Includes extended property scripting as part of object scripting.

SQLDMOScript2_FullTextCat

2097152

The command batch includes Transact-SQL statements creating Microsoft Search full-text catalogs.

SQLDMOScript2_FullTextIndex

524288

The generated script includes statements defining Microsoft Search full-text indexing. It applies only if scripting references a SQL Server table. It includes security identifiers for logons scripted.

SQLDMOScript2_JobDisable

33554432

Disables the job at the end of script creation.

SQLDMOScript2_LoginSID

8192

Includes security identifiers for logins scripted.

SQLDMOScript2_NoCollation

8388608

Does 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

The generated script does not include an 'ON <filegroup>' clause directing filegroup use. It applies only if scripting references a SQL Server table.

SQLDMOScript2_/NoWhatIfIndexes

512

Does not script hypothetical indexes used to implement the CREATE STATISTICS statement. It applies only if scripting references a SQL Server table.

SQLDMOScript2_UnicodeFile

4

The 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. After the list is built, configure component transfer using the ScriptType and Script2Type properties.