drop database error

  • Hi All,

    My working environment is SQL Server 7.0. I have a local server in my PC and let say I create a database called DB1. If another user connects to my local server he/she could work on my DB1 database as well. The problem is when I try to drop the DB1 I get an error saying someone else is using the database. How can I kill there connection without asking the other use to disconnect?

    Any thoughts will be helpful!

  • Type sp_who and find the connections to your database and the SPID they are connected with. Then type KILL (SPID) and it will try to stop their query and disconnect them.

    There are other ways but I forget what they are off hand.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thank you for your reply. I have checked the books on line. It mention that few connections that I should not be deleting them. Particulaly cmd such as:

    AWAITING COMMAND

    CHECKPOINT SLEEP

    LAZY WRITER

    LOCK MONITOR

    SELECT

    SIGNAL HANDLER

    So if another user connects to my DB1 what is the type of cmd will it be? Should I have to check that before deleting them?

    Thanks!

  • AWAITING COMMAND means they are connected, and you should only drop those connections you are sure of look at login name and application in most cases will help.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply