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)
 Jobs overview

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-10 : 17:17:27
Hello,
I have been battling with the topic of jobs in MS SQL for a while now.

when I create a job via

1. exec sp_add_jobstep @job_name = 'test'
2. exec sp_add_jobstep
3. exec sp_add_jobschedule
4. exec sp_add_jobserver

How do i

1. Set the job to execute immediately ?
2. Set another job to run at a particular time

3. Where are these jobs kept ?

I checked here

select * from sysjobs
select * from sysjobservers
select * from sysjobsteps

and

4. How do they work ? I been searching books online for jobs overview, but cant seem to find it.

Please help

Thanks






_____________________


Yes O !

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-10 : 17:23:17
1. sp_start_job
2. Use the same process you listed
3. The jobs are stored in the msdb database in a few tables. You've listed some of them. There is also sysjobschedules and others.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-10 : 17:34:38
Ok, thanks

If i run sp_start_job 'test' in a stored procedure, as am calling it from my web page, does the SP wait for the job to finish before giving a status code to the web page, or it releases the resources immediately ?

_____________________


Yes O !
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-10 : 17:39:28
Are there any articles, blogs or good books i can get to learn more about jobs.

... As i cant find it on MS website

_____________________


Yes O !
Go to Top of Page
   

- Advertisement -