Hi Every one, Is there any chance to get the dead lock victims code / queries in a Production database. We cant on the trace files in Error Log to capture the information bcz we dont have permissions to access the errorlog. So Please tell me a way to find out the dead lock queries.
To get deadlocks you have a few choices. First, you can use Traceflag 1222. Setting that will output the deadlock graph to the error log. If you don't have permission there, then you can use Extended Events in 2008 and better to capture the deadlock_xml_report event to get a deadlock graph that will show you everything you need. But, you have to set that up ahead of time. For servers prior to 2008 you can capture deadlock graphs using trace events. These you will also have to set up ahead of time. If you haven't set up extended events yet, you can't get information except from the error log (which you say you can't reach, but that will only help if the traceflags are already set).