Lock SQL table for a period of time
In SQL Server Management Studio, run this TSQL script (set timeout to whatever suits you)
SET TRANSACTION ISOLATION LEVEL SERIALIZABLEGOBEGIN TRANSACTIONUPDATE tableSET ColumnName = ColumnNameWAITFOR DELAY '00:02:00' -- 2 minutes hh:mm:ss-- Run your test while table is locked and delay is counting downROLLBACK TRANSACTION
Using another session,
Do a
BEGIN TRANSACTION
Call
UPDATE table set columnName = columnName
Run your test
Verify your results
COMMIT TRAN / ROLLBACK TRAN
the transaction