Expand Minimize
This topic has not yet been rated - Rate this topic

Database.SetOffline Method

Sets the database offline.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
public void SetOffline()

When the database is online, you can use this method to take it offline.

  'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server

'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")

'Take the database offline
db.SetOffline()

'Bring the database back online.
db.SetOnline()
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.