Last active
December 14, 2015 12:58
-
-
Save 65/5090109 to your computer and use it in GitHub Desktop.
Create SQL server deadlock simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create table vin_deadlock (id int, Name Varchar(30)) | |
GO | |
Insert into vin_deadlock values (1, 'Vinod') | |
Insert into vin_deadlock values (2, 'Kumar') | |
Insert into vin_deadlock values (3, 'Saravana') | |
Insert into vin_deadlock values (4, 'Srinivas') | |
Insert into vin_deadlock values (5, 'Sampath') | |
Insert into vin_deadlock values (6, 'Manoj') | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin Tran | |
Update vin_deadlock | |
SET Name = 'Manoj' | |
Where id = 6 | |
WAITFOR DELAY '00:00:10' | |
Update vin_deadlock | |
SET Name = 'Vinod' | |
Where id = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin Tran | |
Update vin_deadlock | |
SET Name = 'Vinod' | |
Where id = 1 | |
WAITFOR DELAY '00:00:10' | |
Update vin_deadlock | |
SET Name = 'Manoj' | |
Where id = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment