SQL Server 2000 - Update rows and return updated rows?

You can't in SQL Server 2000 cleanly What you can do is use a transaction and some lock hints to prevent a race condition. Your main problem is 2 processes accessing the same row(s), not a deadlock. See SQL Server Process Queue Race Condition for more, please BEGIN TRANSACTION SELECT * FROM TABLE WITH (ROWLOCK, READPAST, UPDLOCK) WHERE Locked = 0 UPDATE TABLE SET Locked = 1 WHERE Locked = 0 COMMIT TRANSACTION I haven't tried this, but you could also try a SELECT in an UPDATE trigger from INSERTED.

You can't in SQL Server 2000 cleanly What you can do is use a transaction and some lock hints to prevent a race condition. Your main problem is 2 processes accessing the same row(s), not a deadlock. See SQL Server Process Queue Race Condition for more, please.

BEGIN TRANSACTION SELECT * FROM TABLE WITH (ROWLOCK, READPAST, UPDLOCK) WHERE Locked = 0 UPDATE TABLE SET Locked = 1 WHERE Locked = 0 COMMIT TRANSACTION I haven't tried this, but you could also try a SELECT in an UPDATE trigger from INSERTED.

It works. Thank you. I also added the link from the original thread for reference.Mssqltips.Com/tip.

Asp? Tip=1257 – Win Jul 12 at 22:54.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions