Condividi tramite


CreationScriptOptions Property

Questa caratteristica verrà rimossa a partire da una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The CreationScriptOptions property specifies creation attributes for database objects implementing a replication article.

Sintassi

object.CreationScriptOptions [=value]

Parts

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

  • value
    Specifies article-implementing object creation as described in Settings.

Settings

Constant

Value

Description

SQLDMOCreationScript_/ClusteredIndexes

16

Includes clustered index creation on tables in the script.

SQLDMOCreationScript_Collation

4096

Replicates column-level collation.

SQLDMOCreationScript_/CustomProcs

2

Generates custom stored procedures for the article if defined (transactional replication only).

SQLDMOCreationScript_/DisableScripting

0

Does not script.

SQLDMOCreationScript_/DRI_Checks

1024

Includes creation of check constraints during creation of tables in the script.

SQLDMOCreationScript_/DRI_Defaults

2048

Includes creation of column defaults during creation of tables in the script.

SQLDMOCreationScript_/DRI_ForeignKeys

512

Includes creation of foreign keys during creation of tables in the script.

SQLDMOCreationScript_/DRI_PrimaryKey

128

Includes definition of primary keys on tables in the script.

SQLDMOCreationScript_/DRI_UniqueKeys

16384

Includes creation of unique keys during creation of tables in the script.

SQLDMOCreationScript_/ExtendedProperties

8192

Replicates extended properties.

SQLDMOCreationScript_/NonClusteredIndexes

64

Includes nonclustered index creation on tables in the script.

SQLDMOCreationScript_/PKUKAsConstraints

32768

Include creation of primary keys and unique keys during creation of tables as constraints instead of as indexes in the script.

SQLDMOCreationScript_/PrimaryObject

1

Includes object creation in the script.

SQLDMOCreationScript_/UDDTsToBaseTypes

32

Converts all user-defined data types to their Microsoft SQL Server base types when columns are defined in table creation in the script.

SQLDMOCreationScript_/UserTriggers

256

Includes creation of triggers during creation of tables in the script.

Data Type

Long, enumerated

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetCreationScriptOptions(
SQLDMO_CREATIONSCRIPT_TYPE* pRetVal);
HRESULT SetCreationScriptOptions(
SQLDMO_CREATIONSCRIPT_TYPE NewValue);

Osservazioni

The enumerated value is bit-packed. To specify multiple script creation options, combine individual enumeration values using the OR logical operator to define the behavior required.

When an indexed view is published as an indexed view at a subscriber, only SQLDMOCreationScript_ExtendedProperties, SQLDMOCreationScript_NonClusteredIndexes, and SQLDMOCreationScript_UserTriggers are allowed. SQLDMOCreationScript_ClusteredIndexes and SQLDMOCreationScript_PrimaryObject must also be used.

[!NOTA]

If an application sets CreationScriptOptions after the initial snapshot has been created, a new snapshot must be generated and reapplied to each subscription. Snapshots are applied when the next scheduled snapshot and distribution or merge agent run.