Search This Blog

Wednesday 26 February 2014

SQL: Drop SQL Connections

Hi,

Trying to restore a SQL DB or getting the message that there are active connections

Run these scripts to drop the connections:

This will set it offline, Before you can restore you will need to take it online again, if i remember correctly...
USE master
GO
ALTER DATABASE YourDatabaseName
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
Ok, here is one way to do it fr now, will add some more when/if i need it.

No comments:

Post a Comment