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 Administration (2000)
 Disable a job step?

Author  Topic 

ratinakage
Starting Member

16 Posts

Posted - 2007-10-19 : 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
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-10-19 : 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?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-19 : 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
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-20 : 01:04:26
You can create job without schedule, then run it from your app.
Go to Top of Page

ratinakage
Starting Member

16 Posts

Posted - 2007-10-22 : 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?
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-10-22 : 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.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-22 : 22:54:17
Can you just call whatever code in job step directly in your app?
Go to Top of Page
   

- Advertisement -