September 30, 2007 at 4:01 am
Comments posted to this topic are about the item usp_KillConnections
October 5, 2007 at 7:33 am
Nice stored procedure to kill processes but I don't understand when you would use it?
If you need everyone out of a database and need them to stay out, then I'd use:
ALTER DATABASE [MyDatabase] SET SINGLE_USER WITH ROLLBACK AFTER n SECONDS
do maintenance tasks here
ALTER DATABASE [MyDatabase] SET MULTI_USER
While the maintenance tasks are running, no one else can connect.
If you need to restrict it to admins only, then use RESTRICTED_USER instead of SINGLE_USER.
Just a thought,
Joe
October 5, 2007 at 10:17 am
For my case, after I kill user connections by using this kind of stored procedure, our application re-connects to database right away. I believe that it is the good choice to put your database in single user mode.
October 22, 2007 at 8:59 am
You neglected to include the net send logic.
January 23, 2008 at 2:23 pm
hi,
its soo helpful script for me. so simple to run. really appreaciatable.
thx
sreejith
MCAD
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply