This is an over-simplified explanation of what I\'m working on.
I have a table with status column. Multiple instances of the application will pull the contents of the f
You could use the OUTPUT statement.
DECLARE @Table TABLE (ID INTEGER, Status VARCHAR(32))
INSERT INTO @Table VALUES (1, 'New')
INSERT INTO @Table VALUES (2, 'New')
INSERT INTO @Table VALUES (3, 'Working')
UPDATE @Table
SET Status = 'Working'
OUTPUT Inserted.*
FROM @Table t1
INNER JOIN (
SELECT TOP 1 ID
FROM @Table
WHERE Status = 'New'
) t2 ON t2.ID = t1.ID