共用方式為


DetachDatabase 方法

Detaches a database from the instance of SQL Server. 

多載清單 

  名稱 描述
公用方法 DetachDatabase(String, Boolean) Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
公用方法 DetachDatabase(String, Boolean, Boolean) Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.

頂端

備註

The data and transaction log files of a database can be detached and then reattached to the same or another instance of SQL Server. Detaching and attaching a database is useful if you want to change the database to a different instance of SQL Server on the same computer, or if you want to move the database.