Technical Article

Easily Kill All Users In A Database

,

This simple script (ran from the master database) in Query Analyser removes all the requirements of collating currently connected spids to a database and the need to systematically open a cursor to kill each spid individually by simply placing the database offline, then immediately online.

alter database pubs set offline with rollback immediate
go
alter database pubs set online

Rate

(1)

You rated this post out of 5. Change rating

Share

Share

Rate

(1)

You rated this post out of 5. Change rating