stardv
January 27th, 2005, 02:50 PM
I have read up about transactions a little. I am just confused in one part. I just want to make sure I understand it right.
Will this code solve the problem:
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
GO
BEGIN TRANSACTION
SELECT * FROM Mytable with (rowlock)
UPDATE Mytable ....
...
COMMIT TRANSACTION
lets say if some other thread with transaction #2 is trying ot access the record being accessed by transaction #1 before it is committed, will it throw an error, or transaction #2 will be placed in queue until record gets unlocked.
selected in the transaction #1
thank you so much
Will this code solve the problem:
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
GO
BEGIN TRANSACTION
SELECT * FROM Mytable with (rowlock)
UPDATE Mytable ....
...
COMMIT TRANSACTION
lets say if some other thread with transaction #2 is trying ot access the record being accessed by transaction #1 before it is committed, will it throw an error, or transaction #2 will be placed in queue until record gets unlocked.
selected in the transaction #1
thank you so much