Gediminas (Gedas) Gudenas

Sql Server 2005 Delete Maintenance Plan Error

April 20, 2007 · 26 Comments

Below is the manual SQL fix to address this error:

Drop failed for Job ‘XXXXXXXXXXXXX’. (Microsoft.SqlServer.Smo)

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. (Microsoft SQL Server, Error: 547)

Here is the SQL to fix this:

–NOTE: Replace “MaintenancePlan” with the value in the Jobs under SQL Server Agent, put the job name

USE [msdb]
declare @job_name varchar(100)
set @job_name = N'MaintenancePlan'

–First, delete the logs for the plan

delete sysmaintplan_log
FROM sysmaintplan_subplans AS subplans INNER JOIN
sysjobs_view AS syjobs ON subplans.job_id = syjobs.job_id INNER JOIN
sysmaintplan_log ON subplans.subplan_id = sysmaintplan_log.subplan_id
WHERE (syjobs.name = @job_name)

–delete the subplan

delete sysmaintplan_subplans
FROM sysmaintplan_subplans AS subplans INNER JOIN
sysjobs_view AS syjobs ON subplans.job_id = syjobs.job_id
WHERE (syjobs.name = @job_name)

–delete the actual job (You can do the same thing through Management Studio (Enterprise Manager)

delete
from msdb.dbo.sysjobs_view where name = @job_name

If you get this error:

Msg 547, Level 16, State 0, Line 27
The DELETE statement conflicted with the REFERENCE constraint “FK__sysjobsch__job_i__276EDEB3″. The conflict occurred in database “msdb”, table “dbo.sysjobschedules”, column ‘job_id’.

Open the Job and Delete the Schedules

→ 26 CommentsCategories: Tech

ClickOnce SignTool Failed to Sign

January 22, 2007 · 2 Comments

I just got couple errors by using ClickOnce to publish my app:

Cannot publish because a project failed to build.
SignTool reported an error ‘Failed to sign bin

This most likely means that you have a “Sign the ClickOnce Manifests” checkbox checked in “Signing” Tab of your project properties and your certificate has expired.

To resolve this:

  • Right click on project in VS 2005 Solution Explorer and choose properties.
  • Go to “Signing” Tab,
  • Click on “Create Test Certificate”, make up a password and enter it.
  • Now you can go back to “Publish” Tab and publish your app.

signingscreenshot.JPG

→ 2 CommentsCategories: Tech

MIT OpenCourseWare

January 12, 2007 · Leave a Comment

I was reading somebodies blog (can’t remember which one) and came across a post about MITs OpenCourseWare. The name sounded intriguing and it did not disappoint. Once I saw the video lectures (streaming .rm files) got really excited. I just finished watching the first lecture for 6.002 Circuits and Electronics course and the professor is great. Always wondered how a top technology school prepares their students. It’s been about 4 years since I last took my Masters capstone class (not at MIT), but this is really making me miss being in school (on second thought…). Anyways, always wanted to learn some basic engineering, but never really had time or enough discipline to really follow through. This is really helpful for self learners, just being able to watch the lectures at your own pace is really nice. Great job by MIT to make this available and if you ever wondered what it’s like to be an MIT student, now you can (I think I am starting to sound like a commercial). Just started to feel like I need to put one of those really small disclaimers that I am in no way or form associated with MIT. Ok, now that I got that out of the way, gonna go to sleep.

→ Leave a CommentCategories: Tech