8/23/2023 0 Comments Sql server deadlock traceflag![]() ![]() Lastbatchstarted=T17:05:03.460 lastbatchcompleted=T17:05:03.457 lastattention=T00:00:00.457Ĭlientapp=Microsoft SQL Server Management Studio - Query hostname=XXXXXX Transactionname=user_transaction lasttranstarted=T17:05:03.470 The name of the application who performed the Query (clientApp) The spid of the process who performed the Query Here below in blu we can read who is the second Query involved In red some useful infos: The process id of the Query 17:05:38,spid23s,Sconosciuta,executionStack 17:05:38,spid23s,Sconosciuta,UPDATE dbo.TestTableA SET Qty = 100 WHERE Code = 1 Here we can read what is the first Query involved in the deadlock 17:05:38,spid23s,Sconosciuta,UPDATE dbo.TestTableB SET Qty = 200 WHERE Code = 3 17:05:38,spid23s,Sconosciuta,waiter id=process17b8d047c28 mode=U requestType=wait 17:05:38,spid23s,Sconosciuta,waiter id=process17b8d047848 mode=U requestType=wait Now let's see where to find just some basic but useful informations.įirst, note that every lock have the same date for example: " 17:05:38". UPDATE dbo.TestTableA SET Qty = 400 WHERE Code = 1īelow i reported the deadlock generated by the T-SQL commands of the previous paragraph. UPDATE dbo.TestTableB SET Qty = 300 WHERE Code = 3 In a second session (open another windows in SSMS) WAITFOR DELAY '00:00:30' UPDATE dbo.TestTableB SET Qty = 200 WHERE Code = 3 In a first session (open a new windows of the management studio)īEGIN TRAN UPDATE dbo.TestTableA SET Qty = 100 WHERE Code = 1 ![]() I suggest personally to try these T-SQL command in order to understand how deadlock works Let’s now take two minutes to see how to simulate a deadlock. Now "between other informations" you can see also the information related to deadlock.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |