CreateForAttach Property
后续版本的 Microsoft SQL Server 将删除该功能。 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The CreateForAttach property controls database file creation when the Database object is added to the Databases collection of a connected SQLServer object.
语法
object.CreateForAttach [=value]
Parts
object
An expression that evaluates to an object in the Applies To listvalue
TRUE or FALSE
Data Type
Boolean
Modifiable
Read/write
Prototype (C/C++)
HRESULT GetCreateForAttach(LPBOOL pRetVal);
HRESULT SetCreateForAttach(BOOL NewValue);
注释
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).
注意 |
---|
CreateForAttach can only be set when the database is initially created. |