TSQL to Kill All Connections to a Database

0 Flares Twitter 0 Facebook 0 StumbleUpon 0 Google+ 0 LinkedIn 0 0 Flares ×

Awesome snippet of code from Nick Xu’s SQL Server Blog to kill all connections to a database. Really useful when you’re getting messages like ‘Exclusive access could not be obtained because the database is in use’.

I should mention – DON’T GO USING THIS ON YOUR PRODUCTION DATABASES!!!

Thank you Nick Xu!

The Essential App Marketing Kit
Subscribe To My Newsletter To Get an Entire Chapter From The Book for FREE
Never display this again
0 Flares Twitter 0 Facebook 0 StumbleUpon 0 Google+ 0 LinkedIn 0 0 Flares ×