| Author |
Topic  |
|
|
ratinakage
Starting Member
16 Posts |
Posted - 10/19/2007 : 07:21:39
|
Hey guys,
I posted this question in the t-sql section and then realized its probably more relevant to SQL Server 2000. Anyways...
I know you can disable a SQL job. What I want to know is, if anyone can think of a clever way to disable a job step?
Basically, I want to create a big SQL job with all the steps disabled. Then as the users of my app turn certain things on, the job steps should become activated (or enabled).
My first thought was to do something like this.
1. dummy step. Next step = 3 2. real step a Next step = 3 3. dummy step Next step = 5 4. real step b Next step = 5 5. dummy step Next step = 7 6. real step c Next step = 7 ....
Where you basically have a job so that none of the steps are enabled and they are all skipped over. Then as things need to be enabled, you just change the next step to next step - 1 (or something like that)
Its a bit messy. Can you think of anything else?
Thanks,
|
|
|
AndrewMurphy
Flowing Fount of Yak Knowledge
Ireland
2915 Posts |
Posted - 10/19/2007 : 07:33:16
|
Is this a timed job executed from SQL Agent, or an on-request job? what should happen if 2 or more wish to run the job at the same time?...with different options?
What are you trying to offer the end users in business terms? |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
Posted - 10/19/2007 : 08:31:21
|
"I posted this question in the t-sql section and then realized its probably more relevant to SQL Server 2000."
And now people have started answering it in both places without realising there are already answers in the other thread, and will feel that you are wasting their time.
Please do not post in multiple forums on this site.
Thank you.
Kristen |
 |
|
|
rmiao
Flowing Fount of Yak Knowledge
USA
7266 Posts |
Posted - 10/20/2007 : 01:04:26
|
| You can create job without schedule, then run it from your app. |
 |
|
|
ratinakage
Starting Member
16 Posts |
Posted - 10/22/2007 : 02:00:49
|
Hey guys,
Thanks for the replies...
I want to configure it in SQL server agent.
@rmiao, The job should be scheduled to run once a day. Furthermore, any of the steps can be run on demand from within the app. The reason for this is that each step runs a report. So, at the end of the day, all reports are run but they can also be run on demand throughout the day.
Any ideas? |
 |
|
|
AndrewMurphy
Flowing Fount of Yak Knowledge
Ireland
2915 Posts |
Posted - 10/22/2007 : 12:30:43
|
how about ...create a table called reportrequests or whatever catches your fancy.
id, date asked, owner (etc), rundate, reportid, status (date, time, output?, etc)
when running the report via a SP, select from the "reportrequests" table for the required rundate and the required reportid/name....if no record, no run. if a record continue. when report finished....mark corresponding record complete. |
 |
|
|
rmiao
Flowing Fount of Yak Knowledge
USA
7266 Posts |
Posted - 10/22/2007 : 22:54:17
|
| Can you just call whatever code in job step directly in your app? |
 |
|
| |
Topic  |
|