Translate

Showing posts with label SQL database offline. Show all posts
Showing posts with label SQL database offline. Show all posts

Thursday, March 10, 2011

Take sql database offline using query

If you try to take the MS SQL database offline by right clicking and selecting "take offline", it almost always hangs.

Try this instead 


use master
alter database databaseName set  offline with rollback immediate



To bring it back online do this:


use master
alter database databaseName set  online