Tuesday, March 3, 2015

Script for make DB offline and make Online

If you trying to restore large database  it will take log time if you try take the database offline with the  Graphical interface.
Thereis a sql command that we can do this. trust me this is much faster.

USE master
GO
ALTER DATABASE database name
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO

to get the database online

GO
ALTER DATABASE database name
SET ONLINE 
GO

0 comments:

Post a Comment