Groups | Blog | Home
all groups > sql server programming > june 2006 >

sql server programming : Enumerating jobs on a SQL server using SMO - in C#


SQLguythere
6/26/2006 11:02:01 PM
Hi all, I'm trying to connect to SQL and enumerate all Agent jobs to find a
particular and call job.envoke on it.

Looked every where but can't find a code snippet on it or a sample.

Anyone can assist? Cheers
Omnibuzz
6/26/2006 11:14:01 PM
You can use this to list all the jobs.

USE msdb
EXEC sp_help_job


--
-Omnibuzz (The SQL GC)

http://omnibuzz-sql.blogspot.com/
Omnibuzz
6/27/2006 12:12:01 AM
Oops.... Just read the subject line about SMO.. My fault..
You can try this link..

http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.agent.aspx

--
-Omnibuzz (The SQL GC)

http://omnibuzz-sql.blogspot.com/


SQLguythere
6/27/2006 8:31:01 AM
Thanks omnibuzz, I've tried that uri but since I'm new to SQL prog I haven't
figured out how to use for instance jobbasecollection classes to find out if
the job I'm interested in exist on the server.

Any help there with the code\implementation? Thanks.

[quoted text, click to view]
AddThis Social Bookmark Button