I wanted to change several jobs on our MS SQL Server just now. I got the following error when I tried saving a job after deleting a step:
Error 14724 Cannot add, update, or delete a job (or its steps or
schedules) that originated from an MSX server.
After using my friend (Google that is), I found out that the reason for the error is that a job remembers the name of the server on which it was originally created on. If the name of the server changes after the job has been created, and you want to edit that job, it will not be possible to do so.
The only solution is to change the originating_server attribute of the job to the current servername.
You can do this by executing the following transact-sql command:
SET originating_server = CONVERT(nvarchar, SERVERPROPERTY('servername'))
WHERE originating_server <> CONVERT(nvarchar, SERVERPROPERTY('servername'))
Do note that some solutions online will offer the following answer:
SET originating_server = @@SERVERNAME
WHERE originating_server <> @@SERVERNAME
Which is not entirely correct, as @@SERVERNAME doesn’t automatically update itself, as explained here [ msdn.microsoft.com ]:
Although the @@SERVERNAME function and the SERVERNAME property of SERVERPROPERTY function may return strings with similar formats, the information can be different. The SERVERNAME property automatically reports changes in the network name of the computer.
In contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports changes made to the local server name using the sp_addserver or sp_dropserver stored procedure.
Make sure you first do a select * from msdb.dbo.sysjobs to make sure you don’t mess up your system 😉