MsSQL Server: How can I drop DB using T-SQL?

$0
=
$0
+
$0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

I want to drop my DB and close all connections before it

When I try to do it I receive this message:

Cannot drop database "DBName" because it is currently in use.

Thanks..

1 Answer - total earned - 0 BTC ($0 USD)

1
=
0
=
$0
Internet users could send Bitcoin Tips to you if they like your answer!
  1. Close all active connections:

    ALTER DATABASE <DBName> set single_user with rollback immediate

  2. Drop your database:

    DROP DATABASE <DBName>

;)

SEND BITCOIN TIPS
0

Post Answer