Reputation: 22973
Is there a command/SQL query to lock a particular table in MS SQL Server to stop all related transactions using ODBC?
Upvotes: 2
Views: 2316
Reputation: 3837
Use the table hints, such as:
SELECT * FROM MyTable WITH (TABLOCK, HOLDLOCK)
See Table Hints in Books Online for more details.
Upvotes: 3