Re: How to bring down a database

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 07/08/04


Date: Thu, 8 Jul 2004 23:11:53 +0100

Assuming you have already logged out or killed all user processes you can
take the DB offline as follows:

EXEC sp_dboption 'DATABASE_NAME', 'offline', 'TRUE'

Perhaps more useful is to make the database single-user only:

USE DATABASE_NAME
EXEC sp_dboption 'DATABASE_NAME', 'single user', 'TRUE'

-- 
David Portas
SQL Server MVP
--