Being DBA or database professional most of us need to take databases offline and bring online for many reason. Below script will hep you to take a database offline and bring line back.
USE master
GO
-- Script to
take the database offline
ALTER DATABASE [Your DBNam>] SET OFFLINE WITH
ROLLBACK IMMEDIATE
GO
-- Script to
bring the database online
ALTER DATABASE [Your DBNam>] SET ONLINE
GO
No comments:
Post a Comment