Solved

can't drop the database because it's currently in use

Posted on 2007-04-06
2
590 Views
Last Modified: 2008-02-01
I am trying to delete a SQL Database and I keep getting the same error:

can't drop the database because it's currently in use

No one is using this or even connected to it.  What am I doing wrong?  I am using SQL Server 2000.
0
Comment
Question by:gpotenza
2 Comments
 
LVL 11

Accepted Solution

by:
dready earned 500 total points
ID: 18863520
it always helps to just stop and restart the sql server (from.the sql server service managaer or from enterprise manager) Don't know if it is the most elegant way, and if it is a server where you can do that. But if it is a develpment machine that noone uses, that will do the trick. If restarting is not an option, i dont really know what to do.
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 18863540
run this (query analyzer) ...

alter database set read_only with rollback immediate (kills all connections)
use master
go
drop database <yourdb>

Hope this helps
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question