MSSQL 2005 Drop all database connections
So after some struggling with Microsoft SQL Server 2005 not allowing me to run a script that drops a database and recreates it again because there is still active connections on the database I came up with this solution.
USE master
GO
ALTER DATABASE database name
SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE database name
SET ONLINE


Leave a Reply