To All:
How do you make sure a job does not run until a first step job finishes.
For example you want to make sure a "dbcc CHECKDB" does not run until a
backup job finishes.
Thanks
TunjiYou mean you have 2 seperate jobs and you want to run
them back to back?
What I am aware are 1. combine the 2 jobs into one
or 2. in the second job, check the jobhistory table to
see if the first one finishes or not.
>--Original Message--
>To All:
>How do you make sure a job does not run until a first
step job finishes.
>For example you want to make sure a "dbcc CHECKDB" does
not run until a
>backup job finishes.
>Thanks
>Tunji
>
>.
>|||Thanks Keene.
Yes, if you have 2 seperate jobs ... I want the second job to run only after
the first job finishes.
Thanks for your response.
"Keene" <anonymous@.discussions.microsoft.com> wrote in message
news:1a7e801c41e3c$55b17220$a501280a@.phx
.gbl...
> You mean you have 2 seperate jobs and you want to run
> them back to back?
> What I am aware are 1. combine the 2 jobs into one
> or 2. in the second job, check the jobhistory table to
> see if the first one finishes or not.
> step job finishes.
> not run until a|||When there are 2 separate jobs, there is no easy way to do this... Even if
you create another job which does an sp_start_job on each of the other jobs,
they will run concurrently. When the first job is started, the next
statement runs...
You can put each of the steps in both jobs into a single job with multiple
steps, then they will run as you wish, but that leaves you with a single
huge job...
Some folks write programs which use SQL DMO to query the status of one job
prior to programmatically starting the second... This is often too much
trouble as well... Most folks simply check the elapsed times of jobs and
adjust the start times occasionally..
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.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
"Tunji" <Tunj@.hotmail.com> wrote in message
news:e3ZYXjjHEHA.3696@.TK2MSFTNGP10.phx.gbl...
> To All:
> How do you make sure a job does not run until a first step job finishes.
> For example you want to make sure a "dbcc CHECKDB" does not run until a
> backup job finishes.
> Thanks
> Tunji
>|||Thanks Wayne!
That was helpful.
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:uDpNCAkHEHA.1528@.TK2MSFTNGP09.phx.gbl...
> When there are 2 separate jobs, there is no easy way to do this... Even
if
> you create another job which does an sp_start_job on each of the other
jobs,
> they will run concurrently. When the first job is started, the next
> statement runs...
> You can put each of the steps in both jobs into a single job with multiple
> steps, then they will run as you wish, but that leaves you with a single
> huge job...
> Some folks write programs which use SQL DMO to query the status of one job
> prior to programmatically starting the second... This is often too much
> trouble as well... Most folks simply check the elapsed times of jobs and
> adjust the start times occasionally..
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.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
>
> "Tunji" <Tunj@.hotmail.com> wrote in message
> news:e3ZYXjjHEHA.3696@.TK2MSFTNGP10.phx.gbl...
>|||What if i have a job that runs say twice a day (12.00 A.M and 12.00 Noon).
what happens if the 12.00 am job does not finish at 12 noon (next run).
Thanks,
Tunji
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:uDpNCAkHEHA.1528@.TK2MSFTNGP09.phx.gbl...
> When there are 2 separate jobs, there is no easy way to do this... Even
if
> you create another job which does an sp_start_job on each of the other
jobs,
> they will run concurrently. When the first job is started, the next
> statement runs...
> You can put each of the steps in both jobs into a single job with multiple
> steps, then they will run as you wish, but that leaves you with a single
> huge job...
> Some folks write programs which use SQL DMO to query the status of one job
> prior to programmatically starting the second... This is often too much
> trouble as well... Most folks simply check the elapsed times of jobs and
> adjust the start times occasionally..
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.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
>
> "Tunji" <Tunj@.hotmail.com> wrote in message
> news:e3ZYXjjHEHA.3696@.TK2MSFTNGP10.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment