Trouble Deleting a Job

  • I want to delete a job.  When I try using the Management Studio, it gives me an error.

    So I tried with plain SQL: 

    exec sp_delete_job @job_name = 'FTP - Log Only'

    And I get the same error:

    Msg 547, Level 16, State 0, Procedure sp_delete_job, Line 170

    The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans", column 'job_id'.

    The statement has been terminated.

    Has anyone else encountered this, and/or have a suggestion about how to get rid of that job? 

    Thanks,

    Jason

    The Redneck DBA

  • Looks like this job is part of a maintenacne plan.  Do delete it, you will probably need to modify the plan.

  • Oh, good grief.  That's exactly what the problem was.  I feel stupid for missing that one.

    Thanks!

    The Redneck DBA

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

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