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)


By acedba,

This stored proc has helped me a lot when I needed to restore db, reconfigure replication, and do other database jobs. SQL server KILL command can only act on a single spid. This sp compiles KILL commands in a cursor to kill a group of spids based on database name, login name, host machine name or simply kills all except 'sa' when there are no parameters specified. It has been tested on SQL 7 and 2000.

Disclaimer: Use this stored proc at your own risk as killing processes may be undesirable under certain circumstances. Use it with caution.

Total article views: 2224 | Views in the last 30 days: 5