Archive | SQL

TSQL to Kill All Connections to a Database

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!

Continue Reading 0