Partager via


CreateForAttach Property

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement, et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

The CreateForAttach property controls database file creation when the Database object is added to the Databases collection of a connected SQLServer object.

Syntaxe

object.CreateForAttach [=value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list
  • value
    TRUE or FALSE

Data Type

Boolean

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetCreateForAttach(LPBOOL pRetVal);
HRESULT SetCreateForAttach(BOOL NewValue);

Notes

If TRUE, the database is created from files specified in the FileGroups and LogFiles collections.

If FALSE, data files are created as directed by the FileGroups and LogFiles collections.

Creating databases from existing data files is constrained. For more information, see CREATE DATABASE (Transact-SQL).

ms143936.note(fr-fr,SQL.90).gifRemarque :
CreateForAttach can only be set when the database is initially created.

Applies To:

Database Object