Msg 3702, Level 16, State 3, Line 1 Cannot drop database because it is currently in use

Msg 3702, Level 16, State 3, Line 1 Cannot drop database because it is currently in use.

I created a database via script on SQL Server using the following command:

CREATE DATABASE classes

To delete this same database via SQL script, we use the drop command.

DROP DATABASE classes

When I used this command to delete the database classes via SQL Server script, returned the following error: Msg 3702, Level 16, State 3, Line 1 Cannot drop database because it is currently in use

Solution

Use the following command:

USE "the username"
DROP DATABASE classes
USE master
DROP DATABASE classes

 778 Total Visualizações,  2 Visualizações Hoje

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.