Solved

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

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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

751 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