what is the best solution to terminate the update statement when encounters a shared lock?

Update statement should be terminated when encounters a shared lock, what is the best solution?

Update statement should be terminated when encounters a shared lock, what is the best solution?

A.
use with(holdlock)

B.
use sp_who

C.
use sp_lock

D.
use with(nowait)

Explanation:
http://technet.microsoft.com/en-us/library/ms187373.aspx

NOWAIT

Instructs the Database Engine to return a message as soon as a lock is encountered on the table. NOWAIT is equivalent to specifying SET LOCK_TIMEOUT 0 for a specific table.



Leave a Reply 0

Your email address will not be published. Required fields are marked *