Re: Start SQLServerAgent job Synchronously

From: Wayne Snyder (wayne.nospam.snyder_at_mariner-usa.com)
Date: 08/09/04


Date: Mon, 9 Aug 2004 08:00:48 -0400

You could also use SQLDMO, there is a job object and you could check its
completion status...
There is also a tool www.sqlsentry.com which does the kind of thing you are
looking for.

-- 
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Nathan Holmes" <Nathan Holmes@discussions.microsoft.com> wrote in message
news:91106AB0-1E28-4F2A-BB91-501BA7E8DB93@microsoft.com...
> Is there a SQL command that allows you to start a SQLServerAgent job such
> that control doesn't return to the caller until after the job has
completed?
> sp_start_job lets me start a job (self-evidently), but it's an
asynchronous
> call and the caller resumes processing as soon as the call is made. I want
> the caller to wait until after the called job has finished.
>
> Background:
> I have a set of SQLServerAgent jobs, each of which runs a BACKUP DATABASE
> statement for a single database. I want to run several of these backups at
> around the same time every day. I am assuming it is better to reduce disk
> contention by ensuring that only one job runs at once than to let them all
> fight it out for I/O at the same time. I thought I could do this by
creating
> a further 'control' job in SQLServerAgent with a number of steps to call
each
> backup job in turn, waiting for completion before calling the next job,
but
> apparently not - unless you can help me.
>
> Yes, I could combine the existing jobs into a single job or introduce
'best
> guess' lags between the job start times, but (a) I like the one job per
> database approach because it gives me a one-click way of taking an adhoc
> backup and (b) I'd have to keep altering my lag times as the databases
grow.
> The 'start job, wait, start next job' solution seems so neat that I'd be
> surprised if it can't be done. Any help would be greatly appreciated.


Relevant Pages

  • RE: Backups have Shadow Copy Problems
    ... with volume Shadow Copy error 800423f4. ... You back up data from a volume that contains a Microsoft SQL Server ... The recovery model of the SQL Server database is configured to use an ... It just ensures backup will continue without reporting the error. ...
    (microsoft.public.windows.server.sbs)
  • Re: Start SQLServerAgent job Synchronously
    ... Wayne Snyder, MCDBA, SQL Server MVP ... > call and the caller resumes processing as soon as the call is made. ... > I have a set of SQLServerAgent jobs, each of which runs a BACKUP DATABASE ...
    (microsoft.public.sqlserver.server)
  • Re: "Best Practices" way to distribute MSDE
    ... > Restore a users's selected backup. ... for dayly house-keeping I do usually provide scripted job for database ... that file copy operation (not SQL Server backup!) can be performed.. ... my personala advice is to perform dayly house-keeping actions ...
    (microsoft.public.sqlserver.msde)
  • Re: NT Backup Causes Server to Hang
    ... Thanks for using the SBS newsgroup. ... You back up data from a volume that contains a Microsoft SQL Server ... The recovery model of the SQL Server database is configured to use an ... It just ensures backup will continue without reporting the error. ...
    (microsoft.public.windows.server.sbs)
  • Start SQLServerAgent job Synchronously
    ... Is there a SQL command that allows you to start a SQLServerAgent job such ... call and the caller resumes processing as soon as the call is made. ... I have a set of SQLServerAgent jobs, each of which runs a BACKUP DATABASE ...
    (microsoft.public.sqlserver.server)