Wednesday, February 1, 2012

How to Kick People off SQL Server

Sometimes when you try to do something in SQL, like a db restore, it won't let you because of an active connection. If you want to see who it is that's locking up your DB and you want to kick them off, take the following steps:

sp_who - This returns a set of data with all activity on the database. Each connection will have a spid.

kill <spid> - This kills the spid.

Happy killing!

No comments:

Post a Comment