Unable to delete or disable SQL Server job due to error regarding MSX server
Have you ever run across this error before when trying to delete or disable a SQL server job (or edit one):
Cannot add, update, or delete a job (or its steps or schedules) that originated from an MSX server.
This sometimes can happen if you rename a server to another name after you have created your jobs and you try to disable a SQL job. This may be fine if you use a management server, however if you are sure you do not have a management server and you want to fix it up continue to read on.
To inspect all your job information use this command.
use msdb
select * from sysjobs
To make all your jobs, owned so to speak, by the server, issue the following command after you make reasonable precautions (backups, backups, etc):
use
msdb
DECLARE @srv sysname
SET @srv = CAST(SERVERPROPERTY('ServerName') AS sysname)
select @srv
select * from sysjobs
UPDATE sysjobs SET originating_server = @srv
select * from sysjobs
Comments
Anonymous
January 26, 2008
PingBack from http://msdnrss.thecoderblogs.com/2008/01/26/unable-to-delete-or-disable-sql-server-job-due-to-error-regarding-msx-server/Anonymous
August 03, 2009
Thanks this did the trick! Much better than Microsoft's solution which is to script, delete and rebuild the scripts!