Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Running sp_update_job sproc on a linked server

Author  Topic 

DavidSh
Starting Member

4 Posts

Posted - 2007-04-02 : 05:38:35
Hello everyone,

I'm trying to disable a scheduled job by calling the sp_update_job sproc on a linked server that I have set up. As follows:

SELECT @job = job_id
FROM [MyLinkedServer].msdb.dbo.sysjobs
WHERE name = 'Testing Disable Job'

SELECT @job

EXEC [MyLinkedServer].msdb..sp_update_job @job_id = @job,
@enabled = 0

I assume that I've set up the linked server ok as the SELECT statement is working. Here's the result:

63D5E695-85B3-47CE-8362-6C4317111ED0

Server: Msg 14262, Level 16, State 1, Line 25
The specified @job_id ('63D5E695-85B3-47CE-8362-6C4317111ED0') does not exist.

However, the call to the sproc returns the second message. I've checked the job_id returned by querying directly on the linked server. I've also checked that the linked server is RPC enabled.

So, is there a way to run the sproc or do I need to run an UPDATE statement against the sysjobs table to get around this?

I hope this makes sense. Any advice appreciated.

Thanks

David.
   

- Advertisement -