I want to do a SELECT to get a list of ID’s, do an update based on those ID’s and then return those records.
Something like this I guess, I just do not know the syntax:
SELECT WebHookLogIDs = FROM WebHookLog
WHERE Processing=0
AND Processed=0
AND Paused=0
ORDER BY FailCount ASC, WebHookLogID DESC
UPDATE WebHookLog
SET Processing = 1
WHERE WebHookLogID IN(WebHookLogIDs)
SELECT * FROM WebHookLog
WHERE WebHookLogID IN(WebHookLogIDs)
I think its better to put data in Temp table, than insert data in it
because at the last you want to return those record back , so you need to use temp table