Can you explain why you want to do this? Is this for the purpose of testing?
The problem with forcing a deadlock is you have no control over which process will be selected as the victim. It may be your NAS, or it may be the other process. So the behavior may not be what you are expecting.
I want to investigate the behavior of the NAS Windows service when running into a dead lock. I saw some weird behavior where the service automatically stopped or sometimes could not be stopped at all.
Comments
The problem with forcing a deadlock is you have no control over which process will be selected as the victim. It may be your NAS, or it may be the other process. So the behavior may not be what you are expecting.
http://nav-skills.com/2015/09/15/tip-53 ... -are-they/
You can set the deadlock priority to make sure the correct process deadlocks.
sl.LOCKTABLE;
IF sl.FINDSET THEN
REPEAT
UNTIL sl.NEXT = 0;
IF CONFIRM('XXX') THEN;
That quite effectively locks that table for testing purposes.