Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Testing job status T-SQL

Author  Topic 

thieg
Starting Member

4 Posts

Posted - 2003-03-31 : 05:45:40
Hi all,

I have created a DTS that launchs a job within its execution.
I have several others steps that come after this but I want to be sure to execute them after the job is finished.

I know that the job status can be found in sp_help_job but I didn't find a way to use it in my case.

If you have any suggestions to test the job status in T-SQL, I would greatly appreciated.

Thx in advance

-thieg



Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2003-03-31 : 05:47:54
Look at DTS designer - use workflow on success/completion etc.

*#&#* *#&#* *#&#* *#&#*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

thieg
Starting Member

4 Posts

Posted - 2003-03-31 : 05:51:42

DTS doesn't check if the job is still running or not, it executes the step (launching the job) and then go to the next one.

Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2003-03-31 : 06:01:00
Are you running seperate DTS jobs, or one ?

I'm talking about having steps inside 1 DTS package, then using the workflow between jobs to start the next step after completion. With this kind of thing, we have jobs that build temp tables, move data to them, do processing, create final numbers, and then do txt dumps of the data.

As you can see, those are very definitely sequential activities ...

HTH

*#&#* *#&#* *#&#* *#&#*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

thieg
Starting Member

4 Posts

Posted - 2003-03-31 : 06:35:47
Hi thanks for ur help.

I am using only one DTS. One of the step is to launch a Job within the Execute SQL Task using the EXEC sp_start_job command.

I have other further steps that I want to execute in the same DTS but only if the job I launched before is completed. I cannot do that with workflow as the job I launched is executed outside the DTS itself.

Thieg

Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2003-03-31 : 07:30:58
Ok -I'm beginning to see your problem.

Hmmm - is this external job - can it you do any SQL steps at the end of it ? Maybe fire of an osql job, on success in that external job, that will enable/start a job ?

Does this external job HAVE to be an external job - is it an app, or maybe something that can be converted into something that matches/integrates into your process better ?

Do you need to use DTS - what about an external scheduling tool - CA7 cross-platform is something we use here, but AT and chron (unix, but maybe there is a windows port) and many others are out there that can schedule jobs, understand and control dependancies and manage work flow.

HTH

*#&#* *#&#* *#&#* *#&#*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page
   

- Advertisement -