Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TABLOCK And TABLOCKX definition example

Can someone explain TABLOCKX and TABLOCK keyword and show examples anout this keyword.

What is the functions of these 2 words in queries?

Thank you.

like image 933
Tabriz Atayi Avatar asked Apr 30 '26 20:04

Tabriz Atayi


1 Answers

i use the "WITH (TABLOCK)" statement in an insert into an empty clustered table to minimally log the transaction:

INSERT INTO myTable WITH (TABLOCK)
(Column1, Column2...)
SELECT X, Y from Z
like image 158
elvis Avatar answered May 03 '26 08:05

elvis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!