How to take a db offline and back on again with SQL.
-- Take Offline
ALTER DATABASE [MyDatabase] SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
-- Put Online
ALTER DATABASE [MyDatabase] SET ONLINE
GO
How to take a db offline and back on again with SQL.
-- Take Offline
ALTER DATABASE [MyDatabase] SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
-- Put Online
ALTER DATABASE [MyDatabase] SET ONLINE
GO