Is their a way to alter a job step command using T-SQL rather than using
the GUI in enterprise manager?
For example, if I have an existing command of:
BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
Is it possible to alter the above command to a different disk device using
T-SQL?
Message posted via http://www.sqlmonster.com
You an use sp_update_jobstep. You can find more information
on this stored procedure in books online.
-Sue
On Wed, 02 Feb 2005 19:25:39 GMT, "Robert Richards via
SQLMonster.com" <forum@.SQLMonster.com> wrote:
>Is their a way to alter a job step command using T-SQL rather than using
>the GUI in enterprise manager?
>For example, if I have an existing command of:
>BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
>NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
>Is it possible to alter the above command to a different disk device using
>T-SQL?
Showing posts with label example. Show all posts
Showing posts with label example. Show all posts
Wednesday, March 28, 2012
Job Step command altering
Is their a way to alter a job step command using T-SQL rather than using
the GUI in enterprise manager?
For example, if I have an existing command of:
BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
Is it possible to alter the above command to a different disk device using
T-SQL?
Message posted via http://www.droptable.comYou an use sp_update_jobstep. You can find more information
on this stored procedure in books online.
-Sue
On Wed, 02 Feb 2005 19:25:39 GMT, "Robert Richards via
droptable.com" <forum@.droptable.com> wrote:
>Is their a way to alter a job step command using T-SQL rather than using
>the GUI in enterprise manager?
>For example, if I have an existing command of:
>BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
>NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
>Is it possible to alter the above command to a different disk device using
>T-SQL?
the GUI in enterprise manager?
For example, if I have an existing command of:
BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
Is it possible to alter the above command to a different disk device using
T-SQL?
Message posted via http://www.droptable.comYou an use sp_update_jobstep. You can find more information
on this stored procedure in books online.
-Sue
On Wed, 02 Feb 2005 19:25:39 GMT, "Robert Richards via
droptable.com" <forum@.droptable.com> wrote:
>Is their a way to alter a job step command using T-SQL rather than using
>the GUI in enterprise manager?
>For example, if I have an existing command of:
>BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
>NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
>Is it possible to alter the above command to a different disk device using
>T-SQL?
Job Step command altering
Is their a way to alter a job step command using T-SQL rather than using
the GUI in enterprise manager?
For example, if I have an existing command of:
BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
Is it possible to alter the above command to a different disk device using
T-SQL?
--
Message posted via http://www.sqlmonster.comYou an use sp_update_jobstep. You can find more information
on this stored procedure in books online.
-Sue
On Wed, 02 Feb 2005 19:25:39 GMT, "Robert Richards via
SQLMonster.com" <forum@.SQLMonster.com> wrote:
>Is their a way to alter a job step command using T-SQL rather than using
>the GUI in enterprise manager?
>For example, if I have an existing command of:
>BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
>NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
>Is it possible to alter the above command to a different disk device using
>T-SQL?
the GUI in enterprise manager?
For example, if I have an existing command of:
BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
Is it possible to alter the above command to a different disk device using
T-SQL?
--
Message posted via http://www.sqlmonster.comYou an use sp_update_jobstep. You can find more information
on this stored procedure in books online.
-Sue
On Wed, 02 Feb 2005 19:25:39 GMT, "Robert Richards via
SQLMonster.com" <forum@.SQLMonster.com> wrote:
>Is their a way to alter a job step command using T-SQL rather than using
>the GUI in enterprise manager?
>For example, if I have an existing command of:
>BACKUP DATABASE [CE90] TO Disk = 'CE90_20050118.bak' WITH NOINIT ,
>NOUNLOAD , NAME = N'CE90 Full Backup', NOSKIP , STATS = 10, NOFORMAT
>Is it possible to alter the above command to a different disk device using
>T-SQL?
Monday, March 26, 2012
Job Scheduler
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...
>
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...
>
Job Scheduler
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.
> >--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
> >
> >
> >.
> >|||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...
> > 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
> >
> >
>|||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...
> > 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
> >
> >
>
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.
> >--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
> >
> >
> >.
> >|||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...
> > 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
> >
> >
>|||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...
> > 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
> >
> >
>
Job Scheduler
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
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.
>--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...
>
sql
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
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.
>--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...
>
sql
Friday, March 23, 2012
Job Run Time Notifications
Is there a way to send an email alert if a dts job runs
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.As the first step of your DTS job you could start another job that simply
waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
status of the DTS job (you could use sp_help_job). It could then alert if
the job was still running (assuming the DTS job wouldn't start again before
the monitor finished). I'm sure there's a slicker way but that would be
relatively simple and robust
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Tim Savery" <Tim.Savery@.mbna.com> wrote in message
news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
Is there a way to send an email alert if a dts job runs
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.|||To be sure whether the job is still in the current execution, you can
execute msdb..sp_help_job before the wait, and then check execute
sp_help_job and check last_run_date and last_run_time. If the job has been
restarted, these two values would have been changed.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eiBPqZxoDHA.360@.TK2MSFTNGP12.phx.gbl...
> As the first step of your DTS job you could start another job that simply
> waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
> status of the DTS job (you could use sp_help_job). It could then alert if
> the job was still running (assuming the DTS job wouldn't start again
before
> the monitor finished). I'm sure there's a slicker way but that would be
> relatively simple and robust
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Tim Savery" <Tim.Savery@.mbna.com> wrote in message
> news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
> Is there a way to send an email alert if a dts job runs
> for more than a specific time. For example, I want to
> send an alert if a job runs for more than 2 minutes.
>
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.As the first step of your DTS job you could start another job that simply
waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
status of the DTS job (you could use sp_help_job). It could then alert if
the job was still running (assuming the DTS job wouldn't start again before
the monitor finished). I'm sure there's a slicker way but that would be
relatively simple and robust
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Tim Savery" <Tim.Savery@.mbna.com> wrote in message
news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
Is there a way to send an email alert if a dts job runs
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.|||To be sure whether the job is still in the current execution, you can
execute msdb..sp_help_job before the wait, and then check execute
sp_help_job and check last_run_date and last_run_time. If the job has been
restarted, these two values would have been changed.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eiBPqZxoDHA.360@.TK2MSFTNGP12.phx.gbl...
> As the first step of your DTS job you could start another job that simply
> waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
> status of the DTS job (you could use sp_help_job). It could then alert if
> the job was still running (assuming the DTS job wouldn't start again
before
> the monitor finished). I'm sure there's a slicker way but that would be
> relatively simple and robust
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Tim Savery" <Tim.Savery@.mbna.com> wrote in message
> news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
> Is there a way to send an email alert if a dts job runs
> for more than a specific time. For example, I want to
> send an alert if a job runs for more than 2 minutes.
>
Subscribe to:
Posts (Atom)