SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

DB Connection Killer

By Miguel Pereira-543757,

This script opens a little cursor that will clean out connections to any DBs you specify. It will release SPIDs that are active on a DB or which are locking a related SPID. I found the base script some time ago -I wish I remembered the author or location- but I've modified it ever so slightly to provide for a good package that can be used prior to starting a DB restore for example.

Feel free to play with it and adapt it to whatever needs you may have. I've used this, at times, to kill SPIDs which were causing blocking conditions. You should be able to easily modify it to go after very specific conditions.

Total article views: 1349 | Views in the last 30 days: 1