次の方法で共有


PrimaryFile Property

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。 新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。

The PrimaryFile property identifies the operating system file that maintains database-specific system tables.

構文

object.PrimaryFile [= value]

Parts

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

  • value
    TRUE or FALSE

説明

A Microsoft SQL Server database can have, at most, one primary file. When a database is created using SQL Distributed Management Objects (SQL-DMO), the first DBFile object named PRIMARY added to the DBFiles collection of the FileGroup object referencing the filegroup becomes the primary file. Set the PrimaryFile property to alter the default behavior.

Data Type

Boolean

Modifiable

Read/write prior to database creation. Read-only after database creation.

Prototype (C/C++)

HRESULT GetPrimaryFile(LPBOOL pRetVal);
HRESULT SetPrimaryFile(BOOL NewValue);

説明

Running Transact-SQL scripts before an initial snapshot is applied can be used to:

  • Perform presnapshot cleanup.

  • Add users and permissions to databases to be replicated.

  • Create user-defined data types.

    注意注意

    If PreSnapshotScript is set, the script automatically runs when a subscription is reinitialized. Therefore, the script must be written so that its statements are repeatable.

Applies To: