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)
 the database cannot be detached while there are co

Author  Topic 

gamaz
Posting Yak Master

104 Posts

Posted - 2010-01-25 : 11:09:35
Hi,
I need to detach a database and then recreate the database. The database cannot be detached as per the above error. Is there any way to know which connections are currently active with this database and then kill those and then detach or delete the database. My intention is to create a new database after deleting the one that is existing. I appreciate any help. Thanks'

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-25 : 11:12:59
http://www.kodyaz.com/articles/kill-all-processes-of-a-database.aspx
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-25 : 11:41:08
or

alter database yourdb set single_user with rollback immediate
Go to Top of Page

gamaz
Posting Yak Master

104 Posts

Posted - 2010-01-26 : 12:13:28
Thanks visakh16 and russell for the help. I appreciate it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-26 : 12:14:21
welcome
Go to Top of Page
   

- Advertisement -