March 29, 2005 at 8:29 am
Hi all,
How can I simulate a block on the server for testing purposes? I don't want to insert/update/add anything.
I tried hinting a lock without commiting, while running second tran:
QA WINDOW 1:
begin tran
SELECT * FROM dbo.CUSTOMERS with (XLOCK)
QA Window 2:
SELECT * FROM dbo.CUSTOMERS
But that didn't hold a block, and came back very fast.
March 30, 2005 at 1:54 am
how about doing an update but wrapping it in a transaction?
begin transaction
update table set column = value
--rollback transaction
execute the begin and the update, try your select from another window, when you have proved your lock, execute the rollback
March 30, 2005 at 4:50 am
You could also try the second query with an exclusive lock in a transaction - same as the first.
March 30, 2005 at 9:45 am
Thank you
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply