KILL SPIDS PARTICULER DATABASE

  • Hi,

    i want to kill spids of particular database.by killing kill command i am killing single spid.not multiple.how can u solve the problem

  • Not sure I understand what you are asking. so you want to close all the connections to 1 database? Why not take it offline and bring it right back?

  • If you're trying to isolate it for a restore or some other operation, set it to restricted user and use the ROLLBACK IMMEDIATE command. It will immediately cause all connections to go into a rollback, so be very judicious in it's use.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (5/18/2011)


    If you're trying to isolate it for a restore or some other operation, set it to restricted user and use the ROLLBACK IMMEDIATE command. It will immediately cause all connections to go into a rollback, so be very judicious in it's use.

    I'd even consider single user. We have an erp that shall remain nameless but that requires dbo access for all 100+ users.

    So single user would be required here (yes I had the issue while upgrading the app, not fun!).

  • Just as another option the attached script kills all connections to a DB but single user mode would work as well.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply