NEED COMMAND to KILL "all" PROCESSES via a SQL JOB

  • I have a basic, scheduled RESTORE job that fails intermittently -- "CANNOT OBTAIN EXCLUSIVE RIGHTS TO DATABASE".   Resolution is to stop/start SQL Services and job reruns successfully (always!).

    Q: What command can I enter into this same job sequence to aviod this?  Is a KILL all PROCESSES this the best way to assure the DB is available for RESTORE?

    I can't stop/start SQL Services because the job would terminate immediately correct?

    Is there a KILL command available to fry any threads out there?  (FYI, this is a non-production server and I have the permission to KILL anybody on there)

    BT
  • This thread should give you what you need:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=92&messageid=201594

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • The alter database option is the neatest - it's what I use < grin >

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • THANKS Phil!   I followed your recommended thread, found a pre-written proc, implemented it across a half-a-dozen jobs as the 1st step, and all is working great.

    Much appreciated.

    Bill

    BT

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

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