Tuesday, February 21, 2012

Running sql jobs

Hi,
I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
USE msdb
go
EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
I need the first one finish processing then start the second job.
Any ideas?
ThanksYou could create just one job with 2 steps and when the first steps
finished goto the second step.
Charles Deaton
www.SQLSIG.org
mecn wrote:
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks|||I could not make it one job. Business reasons.
Thanks
"Charles Deaton" <sqldba@.comcast.net> wrote in message
news:1163017637.649285.240680@.m73g2000cwd.googlegroups.com...
> You could create just one job with 2 steps and when the first steps
> finished goto the second step.
> Charles Deaton
> www.SQLSIG.org
> mecn wrote:
>|||Create a third job, and set these two jobs as contingent steps.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"mecn" <mecn2002@.yahoo.com> wrote in message
news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>|||I guess you could check for the execution status of the job, in a loop, usin
g sp_help_job.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...[vb
col=seagreen]
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>[/vbcol]|||thanks all, I'll do the test
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OLcLwd3AHHA.4428@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
>I guess you could check for the execution status of the job, in a loop,
>using sp_help_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...

No comments:

Post a Comment