Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single job execution at a time

Status
Not open for further replies.

Hablaras

Programmer
Oct 10, 2003
22
0
0
NL
Hello,

Is there a default setting to set single job execution at a time in SQL Server?

Example
job1 executes at 01:00, finishes at 02:00
job2 is executed at 01:10, but doesn't start (is queued) until 02:00, when job1 has finished

 
If you put them as separate steps in a single job then they will execute one after another.

For any more complicated dependancies you will have to write a scheduler.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Or use DTS, which handles such things with ease and grace.

Sometimes the grass is greener on the other side because there is more manure there - original.
 
>> Or use DTS, which handles such things with ease and grace.

Umm - easier than using sql server?

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
The problem is the jobs are started from a polling application. This application is run every 5 minutes, and if it finds are certain flag-file, indicating an upload of source text files has completed, it starts the job belonging to that flag-file.

I have three types of flag-file and also three distinct jobs. If the sending party would send to different sets of data with their flag-files, the second job would start before the first one has finished. The second one should not start until the first one is finished.

I thought there might be a default switch somewhere that prevents two jobs from running simultaneously, like the "parallel processes" option in a DTS package.
 
I have a scheduler that does exactly this (and a lot more) after writing virtually the same thing for several companies.
It defines steps which will complete or re-schedule and have dependencies between steps and priority windows and alerts. Defaults to single threading but will multi thread on to a sum of defined step values.

It's pretty simple to write something like that and most batch processing systems need it.

I don't like separate flag files as it complicates things - prefer to import data from files whenever they arrive and check dependencies for future steps.
For importing and archiving any files that arrive see

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks! I'll check it out.

Problem with no using flag-files is you are never sure the upload to your inbox is complete (we get our files FTP-ed and this can take as long as 1 hour to complete). Also, if a transmission is aborted half way through a partial file could remain in the inbox. The sending party should reschedule and overwrite this file.

Perhaps there are easier ways, but flag-files seemed the quickest solution to these 2 problems.
 
I saw you removed this scheduler application from your website? :)
 
Just adding it. It's just a list of some of the facilities available and scenarios.
Should be up this evening if I get round to it.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top