Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Stored Procedure Executed Via SQL Job

$
0
0

I have a scheduled job which runs overnight on a SQL2005 server to execute a number of stored procedures to create transactions in one database from transactions in another server/database. All procedures run successfully except one, which should create transactions in four input tables. 

If the stored procedure is run from TSQL the four transactions create successfully in the input tables. If the stored procedure is run as part of the EOD job then transactions are created in only three of the input tables. The result is the same if the stored procedure is executed from the cmd prompt using sqlcmd. 

I tried to get around this by inserting the record in the input table as part of another stored procedure to post the transaction, however the result was the equally unsuccessful. If this second stored procedure is run manually from TSQL then the record is inserted into the input table and the transaction posted. If the stored procedure is executed via a SQL job, then the posting of the transaction fails and there is no transaction in the same input table.

Any thoughts on what the issue may be?  Thank you for your time.


Viewing all articles
Browse latest Browse all 8428

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>