Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    41

    Question Unanswered: Create and Administer SQL Server Agent Jobs via Sprocs?

    Hi,

    Does anyone know if it is possible to set up stored procedures which will create, modify, and disable SQL Server Agent Jobs?

    I have a web based application which I need to enable an administrator to change the frequency which a job runs and encapsulating the modifications in a stored procedure would be the easiest way for me to integrate this, if it's possbible.

    Regards, Matt

  2. #2
    Join Date
    Oct 2003
    Posts
    11

    Cool

    Hi,
    You may use sp_update_jobschedule, sp_update_job etc or if you create your own sp and use tables such as sysjobschedules, sysjobs etc.
    Tables and procs are located in MSDB.
    Ex for updating scheduled time:
    UPDATE msdb.dbo.sysjobschedules
    SET active_start_time = 164000
    WHERE (job_id = '8A0F1080-D22A-4F82-AE13-68F789989D1D')
    AND (name = 'Once')


    Try this and let us know how it work

    Regards
    Last edited by TommyS; 10-30-03 at 11:44.
    Tsz

  3. #3
    Join Date
    Feb 2003
    Posts
    41
    Thanks Tommy,

    Going to give this a shot this afternoon. I'll let you know how it turns out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •