Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Cannot drop database because it is currently in use

USE MASTER;
GO

ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE dbname;
GO
Comment

cannot drop database because it is currently in use

Someone connected to the database. Try to switch to another database and then, to drop it:

Try

SP_WHO to see who connected

and KILL if needed
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql update column default value CURRENT_TIMESTAMP error 
Sql :: select count 
Sql :: concat column data in sql laravel 
Sql :: postgres create extension if not exists 
Sql :: sql server list locks 
Sql :: concatenate two strings in sql 
Sql :: rename table column postgresql 
Sql :: plsql print 
Sql :: datediff 
Sql :: row number mssql 
Sql :: nested if in mysql 
Sql :: sql only five first row 
Sql :: inner join update 
Sql :: oracle select first row order by 
Sql :: oracle pagination query rownum 
Sql :: create temporal table in sql 
Sql :: create mysql database on windows 
Sql :: write sql query to find the second highest salary of employee 
Sql :: mysql record group by created date count 
Sql :: excel export from sql using python 
Sql :: select random sql 
Sql :: sum query in sql 
Sql :: get data every 30 days in sql 
Sql :: sql date format dd-mm-yyyy 
Sql :: json query 
Sql :: check database size in gb mysql 
Sql :: sql server insert inner join 
Sql :: postgres update multiple columns 
Sql :: how to get date in sql 
Sql :: sql set 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =