Msg 3702, Level 16, State 3, Line 2
Cannot drop database “%.*ls” because it is currently in use.
This error message appears when you try to DROP a database for which open connections exist.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. You cannot drop a database while you are connected to it. You must switch the database context before you can drop a database.
All versions of SQL Server.
CREATE DATABASE showme
DROP DATABASE showme
In the above example the error is raised because the database context points to the database that is about to be dropped. This is a quite common mistake. To execute the batch successfully, you need to switch the database context before you can drop the database.