Solved

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

Posted on 2007-04-06
2
599 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

615 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