共用方式為


Server.DetachDatabase Method

Detaches a database from the instance of Microsoft SQL Server.

備註

更新的文字:

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.

只有 Microsoft .NET Framework 2.0 版支援此命名空間、類別或成員。

多載清單

名稱 Description
Server.DetachDatabase (String, Boolean)
Detaches the specified database from the instance of Microsoft SQL Server with the option to update statistics before the database is detached.
Server.DetachDatabase (String, Boolean, Boolean)
Detaches the specified database from the instance of Microsoft SQL Server with the option to update statistics before the database is detached.

請參閱

參考

Server Class
Server Members
Microsoft.SqlServer.Management.Smo Namespace

其他資源

How to: Use an SMO Method with a Parameter in Visual Basic .NET
卸離和附加資料庫
Calling Methods
管理伺服器
卸離資料庫 (一般頁面)