Sunday, March 11, 2012

Can't Delete Job

Hello:
I've got an old job I am trying to delete from my SQL Server 2005.
Everytime I try to delete this, i get the following error:
The DELETE statement conflicted with the REFERENCE constraint
"FK_subplan_job_id". The conflict occred in the database "msdb", table
"dbo.sysmainplan_subplans", column 'job_id'.
I know what an FK is, and why the job can't be deleted, but how do I
resolve this? How can I delete this job?Greg wrote:
> Hello:
> I've got an old job I am trying to delete from my SQL Server 2005.
> Everytime I try to delete this, i get the following error:
> The DELETE statement conflicted with the REFERENCE constraint
> "FK_subplan_job_id". The conflict occred in the database "msdb", table
> "dbo.sysmainplan_subplans", column 'job_id'.
> I know what an FK is, and why the job can't be deleted, but how do I
> resolve this? How can I delete this job?
>
Was the job created by a maintenance plan? Looks like it might have
been, judging from the FK reference. You'll probably have to go through
the maintenance plan to delete the job.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Guess I believe it was -- I was using some sort of Wizard for my first
few jobs until I got my feet wet w/adding jobs w/o using a Wizard....
I'll let you know what I find out.
-Greg
Tracy McKibben wrote:
> Greg wrote:
> > Hello:
> >
> > I've got an old job I am trying to delete from my SQL Server 2005.
> > Everytime I try to delete this, i get the following error:
> >
> > The DELETE statement conflicted with the REFERENCE constraint
> > "FK_subplan_job_id". The conflict occred in the database "msdb", table
> > "dbo.sysmainplan_subplans", column 'job_id'.
> >
> > I know what an FK is, and why the job can't be deleted, but how do I
> > resolve this? How can I delete this job?
> >
> Was the job created by a maintenance plan? Looks like it might have
> been, judging from the FK reference. You'll probably have to go through
> the maintenance plan to delete the job.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Greg wrote:
> Guess I believe it was -- I was using some sort of Wizard for my first
> few jobs until I got my feet wet w/adding jobs w/o using a Wizard....
> I'll let you know what I find out.
Good man!! Leave dem wizards alone...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||It was a stupid wizard thing -- geez...I think Microsoft should leave
the wizarding to Harry Potter...
Thanks for your quick and professional answer!
-Greg
Tracy McKibben wrote:
> Greg wrote:
> > Guess I believe it was -- I was using some sort of Wizard for my first
> > few jobs until I got my feet wet w/adding jobs w/o using a Wizard....
> >
> > I'll let you know what I find out.
> Good man!! Leave dem wizards alone...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

No comments:

Post a Comment