Thursday, 27 October 2016

How to lock a table in MSSQL

Query lock a table in MSSQL:

BEGIN TRAN
SELECT 1 FROM <Table Name> WITH (TABLOCKX)
WAITFOR DELAY '00:11:00'
ROLLBACK TRAN  
GO 

No comments:

Post a Comment