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
 Old Forums
 CLOSED - General SQL Server
 JOBS Question

Author  Topic 

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-06 : 22:01:37
I created a JOB in order to run the S/P on a particular date and time. The JOB is stored in our File Server Windows NT.

How to run the JOB on the server through the computer of the user? Say, the head of the Accounts Receivable Section will just press a key from a VB6 program then it will automatically trigger the JOB on the server. Then the head can leave the office and turn off the computer. The parameter of the S/P is Date and Time. The user must input this before he/she leaves. I cannot fix the date and time on the JOB properties because it depends upon the needs of the user.

Is this possible?

Many thanks.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-06 : 22:48:21
hmm.. although a job, the job was triggered under the context of the client machine and vb exe, if you shutdown the machine,won't this rollback the job?

try a little experiment on your end and see if that's the case, otherwise, what you just explained is ok.

--------------------
keeping it simple...
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-06 : 22:52:52
The main idea here is to trigger the JOB, then leave and turn off the computer.

Please help.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-06 : 23:28:06
if you're looking for the sp try: sp_start_job

--------------------
keeping it simple...
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-06 : 23:53:46
got no sp_start_job at the master database.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-07 : 00:04:45
uhmm, you may want to check BOL, it's msdb.

--------------------
keeping it simple...
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-07 : 19:48:12
Any other suggestion? Calling the attention of robvolk or nr. Please help.

Thanks.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-07 : 20:05:47
Change the user interface to accept the date/time, then have it call sp_add_jobschedule to schedule a one-time running of your job. They can then shut down the computer and SQL Agent will automatically run the job according to that schedule. They can add as many schedules as they like.

Books Online has the syntax for sp_add_jobschedule.
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-07 : 20:16:14
Thanks to your quick reply robvolk, I was expecting that. I'll try your suggestion and give you the result as soon as possible.

Thanks.
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-07 : 20:24:42
robvolk,

I'm using SQL Server 7 and I have no sp_add_jobschedule
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-07 : 20:48:14
Yes you do, it's in MSDB. All job related procedures are in MSDB.
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2004-12-07 : 20:51:57
Yes you are right. I found it. Thanks.
Go to Top of Page
   

- Advertisement -