• 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