sql agent job fails with [SQLSTATE 42000] (Error 2812)

  • hi all: I have a user stored procedure that references some tables in a sql2005 database on another server. It uses some of that data to insert records into a table on the server where the job is running. If I run the sproc from within SMS, it runs as expected. When I schedule it in a job, the job fails with the following log entry:

    01/06/2009 08:41:13,Update Sales Reporting Table,Error,1,SNBNT3\SQL2000,Update Sales Reporting Table,Update Sales Reporting Table,,Executed as user: NT AUTHORITY\SYSTEM. Could not find stored procedure 'SNBCO.dbo.usp_tblAdmin_GP_SalesReport_Update'. [SQLSTATE 42000] (Error 2812). The step failed.,00:00:00,16,2812,,,,0

    I have sa rights on both servers and databases. I have googled this extensively but not found anything that works. Any advice is appreciated. TIA D. Lewis

  • I changed two things, and that seems to have fixed it: 1) I had been referring to the sproc up until today as dbo.xyz...., then this morning just before I posted the question here I changed it to SNBCO.dbo.xyz.... Both resulted in failures. As it turns out the correct path should be SNBCOReports.dbo.xyz.... At the same time as that mistake was corrected, the sysadmin also changed the settings on the server so that SQL Agent was no longer running in local mode (the sproc relies on a linked server in the query).

    Certainly 1) had an effect, and perhaps also 2). D Lewis

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply