Here is a question that updates a value inward the Northwind Shippers tabular array using TABLOCK: ---------- Use Northwind GO UPDATE Shippers WITH (TABLOCK) SET CompanyName='Speedy Gonsalez' WHERE ShipperID=1 -- SELECT * from Shippers ------------ The question updates the cite of the transportation companionship whose ID=1 to a novel name. When TABLOCK is used inward the inward a higher house trend it should endure inside the parenthesis. Read this recommendation from Microsoft: " An UPDATE controversy e'er acquires an exclusive (X) lock on the tabular array it modifies, in addition to holds that lock until the transaction completes. With an exclusive lock, no other transactions tin alter data. You tin specify tabular array hints to override this default demeanour for the duration of the UPDATE controversy past times specifying only about other locking method, however, nosotros recommend that hints endure used solely every bit a concluding resort past
Komentar
Posting Komentar