Home > Archive > MS SQL Server > November 2006 > Running sql jobs









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Running sql jobs
mecn

2006-11-08, 7:12 pm

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


Charles Deaton

2006-11-08, 7:12 pm

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:
> 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


mecn

2006-11-08, 7:12 pm


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:
>



Arnie Rowland

2006-11-08, 7:12 pm

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
>
>



Tibor Karaszi

2006-11-08, 7:12 pm

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...
> 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
>
>

mecn

2006-11-08, 7:12 pm

thanks all, I'll do the test


"Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote in
message news:OLcLwd3AHHA.4428@TK2MSFTNGP04.phx.gbl...[color=darkred]
>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...

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com