Error 14274 Cannot Add Update
Contents |
360 games PC games sp_add_jobserver Windows games Windows phone games Entertainment All Entertainment
Sp_delete_job
Movies & TV Music Business & Education Business Students & educators sp_dropserver Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
SQL Server experts to answer whatever question you can come up with. Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums. SQL Server Forums Profile | ActiveTopics | Members | Search | ForumFAQ Register Now and get your question answered! Username: Password: Save Password Forgot your Password? All Forums SQL Server 2008 Forums Transact-SQL (2008) Cannot add, update, or delete a job https://support.microsoft.com/en-us/kb/281642 (or its steps Reply to Topic Printer Friendly Author Topic rosetulip Starting Member 15 Posts Posted-06/28/2013: 23:58:43 I have a trouble to merge two jobs into a master script file by sharing the same globalization declaration. If I run separately, it works fine.The two jobs are testdbname jobtestnewdb jobIt comes up with the following errorsI http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=186495 got many these messageMsg 14274, Level 16, State 1, Procedure sp_add_job, Line 132Cannot add, update, or delete a job (or its steps or schedules) that originated from an MSX server.Msg 14274, Level 16, State 1, Procedure sp_add_job, Line 132Cannot add, update, or delete a job (or its steps or schedules) that originated from an MSX server.Msg 14274, Level 16, State 1, Procedure sp_add_job, Line 132 Here is two job scriptUSE [msdb]GODECLARE @LLC_DATABASE_NAME NVARCHAR(100) = N'LLC'DECLARE @LLC_LOG_IN_NAME NVARCHAR(100) = N'LLC'DECLARE @Roll_Back_Server NVARCHAR(100) = N'(local)'IF EXISTS (SELECT job_id FROM msdb.dbo.sysjobs_view WHERE name = N'testdbname')EXEC sp_delete_job @job_name = N' testdbname' , @delete_unused_schedule=1IF EXISTS (SELECT job_id FROM msdb.dbo.sysjobs_view WHERE name = N'testnewdb')EXEC sp_delete_job @job_name = N'testnewdb' , @delete_unused_schedule=1/****** Object: Job [testdbname] Script Date: 06/25/2013 16:41:15 ******/BEGIN TRANSACTIONDECLARE @ReturnCode INTSELECT @ReturnCode = 0/****** Object: JobCategory [Database Maintenance] Script Date: 06/25/2013 16:41:15 ******/IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'Database Maintenance' AND category_class=1)BEGINEXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'Database Maintenance'IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollbackEND-- testdbname jobDECLARE @jobId BINARY(16)EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'testdbname'
add, update, or delete a http://stackoverflow.com/questions/3073177/error-14274-cant-delete-then-re-add-job job (or its steps or schedules) that originated from an MSX server. The job was not saved. Reason: SQL Server 2000 supports multi-instances, the originating_server field contains the instance name in error 14274 the format server\instance. Even for the default instance of the server, the actual server name is used instead of (local). After the Windows server is renamed, these jobs still reference the original server name and may not be updated or error 14274 cannot deleted by the process from the new server name. It’s a known problem with SQL2000 SP3. Fix --Verify Server Name SELECT @@servername If SQL name is not correct run. -- if no sp_dropserver <'nameReturned'> -- and then sp_addserver <'correctServername'> , 'local' Print 'Your server name has now been changed, restart SQL Service so changes will take effect.' If SQL name is correct run. --check originating_server column SELECT * FROM msdb..sysjobs --if not USE msdb GO DECLARE @server sysname SET @server = CAST(SERVERPROPERTY('ServerName')AS sysname) UPDATE sysjobs SET originating_server = @server WHERE originating_server = '
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error 14274 - Can't delete & then re-add job up vote 2 down vote favorite I'm trying to create a rather simple script for dealing with SQL Server Agent jobs. It performs 2 tasks: 1) If a given job exists, delete it 2) Create the job (Due to business requirements I can't modify an existing job, the script must delete & re-create it.) Running the script the first time works fine (creates the job). Running any times after that produces error 14274 "Cannot add, update, or delete a job that originated from an MSX server." I've done lots of searching on this, and most solutions center around the server name being changed. My server name has not changed, nor has it ever. Here's what I have: USE [msdb]; SET NOCOUNT ON; DECLARE @JobName NVARCHAR(128); DECLARE @ReturnCode INT; declare @errCode INT; SET @JobName = 'AJob'; BEGIN TRANSACTION; DECLARE @jobId uniqueidentifier; SET @jobId = (SELECT job_id from msdb.dbo.sysjobs where name = @JobName); IF(@jobId IS NOT NULL) -- delete if it already exists begin EXEC @ReturnCode = msdb.dbo.sp_delete_job @job_id=@jobId IF(@@ERROR <> 0 OR @ReturnCode <> 0) begin set @errCode = @@ERROR; GOTO QuitWithRollback; end print 'deleted job'; end -- create the job EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=@JobName, @enabled=1, @notify_level_eventlog=0, -- on failure @notify_level_email=0, @notify_level_netsend=0, -- never @notify_level_page=0, @delete_level=0, @description=NULL, @owner_login_name=N'sa', @notify_email_operator_name=NULL, @job_id = @jobId OUTPUT IF(@@ERROR <> 0 OR @ReturnCode <> 0) begin set @errCode = @@ERROR; GOTO QuitWithRollback; end print 'added job'; -- Server EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId IF(@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; COMMIT TRANSACTION; RETURN; QuitWithRollback: IF(@@TRANCOUNT > 0) ROLLBACK TRANSACTION; print 'Err: ' + CAST(@errCode AS varchar(10)) + ' ret: ' + cast(@ReturnCode