更新时间:2022-11-27 14:50:19
运行此程序,然后尝试插入...
run this and then try your insert...
select * from yourTable with (holdlock,tablockx)
在这里,您可以将其锁定 5 分钟:
here, you can lock it for 5 minutes:
BEGIN TRANSACTION
SELECT * FROM yourTable WITH (TABLOCKX, HOLDLOCK)
WHERE 0 = 1
WAITFOR DELAY '00:05'
ROLLBACK TRANSACTION