views:

67

answers:

2

I have a database in single user mode and I am trying to drop it so I can re-run the creation scripts on it, but I'm being locked out from it.

  1. How do I figure out who has the lock on it?
  2. How do I disable that lock?
+1  A: 

run sp_who, find the spid with the database name you require, kill the spid.

Andy Irving
A: 

From SQL Server Management Studio:

  1. open the object explorer
  2. expand the database server
  3. expand "Management"
  4. double-click on "Activity Monitor"
  5. locate the process using the desired database
  6. right-click on process
  7. click "Kill Process"
Eric Lathrop