SQL Server, How to find deadlocks: the easy way DBCC TRACEON (1204, 1222,-1)
Hi Guys! While in the previous post we talked about finding who's locking our table today i want to show you how to find deadlock! How many times does the customer call you to tell you that they were all blocked? Yeah, today let's talk about how to identify deadlocks! However, we use a method that can trace them in such a way as to avoid being called by the customer when the block occurs . Enjoy the reading! Activate trace flags First of all we need to activate two trace flags through the T-SQL commands below: DBCC TRACEON (1204,-1) GO DBCC TRACEON (1222,-1) GO Now deadlocks will be stored in the SQL Server error log Important: Just remember to disable these trace flag after detected your deadlock. Remember that in this manner these trace flag are enabled until the SQL Server restart Where is located the Error Log You can locate the error log under the SQL Server Agent menu. Look at the image below: Now click on the check hi...