Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
petek
Posting Yak Master
192 Posts |
Posted - 2009-09-29 : 03:39:11
|
Hi all,Is there a way to monitor SQL Deadlocks and record them to a table without using SQL Profiler.Kind RegardsPete. |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2009-09-29 : 10:16:02
|
Turn on trace flag 1222. This will cause SQL Server 2005 to log deadlocks to the SQL Server error logprint 'Show all trace flags that are on'dbcc tracestatus(-1) with no_infomsgs-- Works in SQL 2005 and later.print 'Set on Trace Flag 1222 to log deadlocks'dbcc traceon(1222,-1)dbcc tracestatus(1222) with no_infomsgsprint 'Show all trace flags that are on'dbcc tracestatus(-1) with no_infomsgs Read this for more information:Detecting and Ending Deadlockshttp://msdn.microsoft.com/en-us/library/ms178104.aspxCODO ERGO SUM |
 |
|
|
|
|