Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 stopping sql7 database

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-11-21 : 07:56:09
Thomas Browner writes "Is there away to stop just one database the is under a microsoft sql 7 server. While not stopping the other database under the same server."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-21 : 08:00:52
EXECUTE sp_dboption 'myDatabase', 'offline', 'true'

...or...

ALTER DATABASE myDatabase SET OFFLINE WITH ROLLBACK IMMEDIATE

You may have to kill processes that are connected to that database before you can run the first command; the second one is faster as it will simply rollback any current transactions.
Go to Top of Page
   

- Advertisement -