Sql server deadlock traceflag1/2/2024 ![]() ![]() TraceFlag 1222 puts far more information into the error log than 1204 did, and as such is preferred over 1204 on SQL 2005 and higher. Much the same as the previous one, enabling traceflag 1222 server-wide, either as a startup parameter or using the TRACEON command, writes deadlock info into the error log. ![]() In more recent version of SQL, there are other ways to get at that info, some giving more info, some just giving it in different ways. It’s hard to read, but all the information on what statement finally caused the deadlock and what locks were held and requested is there. SPID: 53 ECID: 0 Statement Type: UPDATE Line #: 11 Input Buf: Language Event: exec CauseDeadlock SPID: 52 ECID: 0 Statement Type: UPDATE Line #: 11 If traceflag 1204 is enabled server-wide, either by adding it as a startup parameter or by using the TraceOn command (DBCC TRACEON(1204,-1)), then anytime the SQL deadlock detector detects and resolves a deadlock, the information on that is written into the SQL Server error log. This is the oldest of the ways to get at the deadlock graph and it’s the main way used on SQL 2000. ![]() This information is generally referred to as the ‘deadlock graph’ There are in fact several ways to get information on what caused the deadlock and on what resources the deadlock occurred. A deadlock can appear to be a very obtuse error, as the only advice offered with the error message is an instruction to ‘rerun the transaction’, and there’s no apparent way to find the cause of the deadlock. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |