Drop database Failed

  • Hi Experts,

    I am getting deadloack error when tried to delete a large DB. The db is have 4 processes which are blocked by one or the other ,all the processes are system processes.

    Msg 1205, Level 13, State 30, Line 1

    Transaction (Process ID 52) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

    Please help.

  • Try setting the database to restricted_user first and see if that helps:

    ALTER DATABASE [YourDbName]

    SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE;

    Twitter: @SQL_JGood
    Blog: sqljgood.wordpress.com/[/url]

  • This will usually work to drop a database that is being used.

    use master;

    alter database [MyDatabase] set offline with rollback immediate;

    alter database [MyDatabase] set online with rollback immediate;

    drop database [MyDatabase];

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

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