usp_KillConnections

  • Comments posted to this topic are about the item usp_KillConnections

  • 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

  • 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.

  • You neglected to include the net send logic.

  • 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