I have a Stored Procedure which is triggered to import/process a bunch of data from an import table. Within the SP is a UPDATE statement which it appears to not get triggered, however all the other statements within the stored procedure run fine.
At the moment if I want this UPDATE statement to run, I have to open the stored procedure within the SQL Server Management tool highlight the UPDATE statement and execute it. All checks show that the UPDATE statement has done what I expected it to do.
Any ideas why this could be happening?
PS. This relates to SQL Server 2008 Enterprise Edition.
You'd have to show the stored procedure in order to get some help here...probably there is some kind of logic in the procedure that prevents it from running.
You'd have to show the stored procedure in order to get some help here...probably there is some kind of logic in the procedure that prevents it from running.
-- Errors UPDATE Feed SET Feed.RowsRejected = e.Errors FROM (SELECT FeedId, SUM(num) Errors FROM (SELECT FeedId, ErrorDuplicate + CASE WHEN ErrorFormat = 1 OR ErrorQuery = 1 THEN 1 ELSE 0 END num FROM ImportErrorSubscriberNumbers) e GROUP BY FeedId) e WHERE e.FeedId = Feed.Id
You'd have to show the stored procedure in order to get some help here...probably there is some kind of logic in the procedure that prevents it from running.
-- Errors UPDATE Feed SET Feed.RowsRejected = e.Errors FROM (SELECT FeedId, SUM(num) Errors FROM (SELECT FeedId, ErrorDuplicate + CASE WHEN ErrorFormat = 1 OR ErrorQuery = 1 THEN 1 ELSE 0 END num FROM ImportErrorSubscriberNumbers) e GROUP BY FeedId) e WHERE e.FeedId = Feed.Id
Do I need to paste the whole procedure do you think ? I am reluctant to share it all.
You don't have to; you can debug it yourself as follows: Insert a few print statements at points from the beginning of the stored proc to just before the update statement is called. Then run the stored proc from an SSMS window and see which of those get printed. I suspect the one just before the update statement won't get printed.