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 2005 Forums
 Transact-SQL (2005)
 where do i determine a job should run once ?

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-11 : 09:05:06
Hello,

1. where do i determine a job should run once ?

2. where do i determine a job should run whenever its called ?

3. based on 2 above

- How do i call this job from a Stored Proc and specify it runs whenever called ?

I believe i use sp_start_job to start the job ? What parameters

thanks



_____________________


Yes O !

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-10-11 : 09:24:26
quote:
Originally posted by mary_itohan

Hello,

1. where do i determine a job should run once ?
A job only runs once - it runs when it is called. If a job is scheduled then the job is "called" by sql agent as the schedule defines.

2. where do i determine a job should run whenever its called ?
If the job is "enabled" it will run whenever it is called.
You can maintain jobs through Management Studio | Object Explorer | <YourServer> | sql agent | Jobs

You can optionally specifiy a schedule in the job properties | schedule tab

3. based on 2 above
see 2

- How do i call this job from a Stored Proc and specify it runs whenever called ?
you can interactively right-click | start
or you can use t-sql (sp_start_job)

I believe i use sp_start_job to start the job ? What parameters
Look at books online at parameters for this proc:
http://msdn.microsoft.com/en-us/library/ms186757(SQL.90).aspx

thanks



_____________________


Yes O !



Be One with the Optimizer
TG
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-12 : 15:22:29
quote:
Originally posted by mary_itohan

Hello,

1. where do i determine a job should run once ?

You can use schedule to run only once

2. where do i determine a job should run whenever its called ?

Using schedule on need basis.

3. based on 2 above

- How do i call this job from a Stored Proc and specify it runs whenever called ?

I believe i use sp_start_job to start the job ? What parameters

thanks



_____________________


Yes O !

Go to Top of Page
   

- Advertisement -