Disable DTS job from SQL?

  • As part of a large data import process, I want to disable the scheduled TLog backup DTS job for the database.

    The database is already in restricted user mode and there are no other connections to the database.

    After obtaining the job's (GUID) id, I craeted this statement as a DTS Execute SQL task:

    UPDATE sysjobs SET enabled = 0 WHERE job_id = 'C6A78A09-48EF-2847-ACAF-38752E4BBDE2'

    The statement runs fine in QA, and the Job Enabled status goes to No in the Jobs listing in EM,

    but the job continued to run per schedule, leading me to wonder if this approach (aside from directly manipulating a system table)  is valid.

    Has anyone else tried this?

     

    TIA,

    dj

  • Have you tried sp_update_job? e.g.

    EXEC sp_update_job @job_name = 'My Job', @enabled = 0

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • That's a very nice way of saying RTFM...  

    Thanks!

    dj

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply