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
Solved

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

Posted on 2007-04-06
2
582 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

856 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