How to insert Locks Problem in Error LOG?

  • Does someone knows , how can i insert Locks or Deadlocks problems in Sql Server Error Log or Windows Event Viewer ?

    Regards,

    Felipe

  • I found this article a while back when I thought of logging deadlocks. I did not go with it as I found the reason for locks was the application.

    Hope it helps you out:

    To capture detailed deadlock information into the error logs, enable the trace flags 1204 and 3605 at the session level using the DBCC TRACEON command. When you enable these trace flags at the session level, only those deadlocks are captured into the error log, in which this session has participated.

    To enable these trace flags at the server level, start your SQL Server from command prompt (sqlservr.exe) with -T1204 and -T3605 parameters. You could also set these trace flags from Enterprise Manager. (Right click on the server, select 'Properties'. Click on 'Startup parameters...'. Add the parameters -T1204 and -T3605 one after another by clicking the 'Add' button.). After setting these trace flags in Enterprise Manager, you must restart your SQL Server service for these trace flags to take effect.

    From the site:

    http://vyaskn.tripod.com/administration_faq.htm#q14

    Look for the link 'How to capture/redirect detailed deadlock information into the error logs?'


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Thanks...This resolved my problem.

     

    Regards,

    Felipe Venancio

  • Glad to hear it. I am having real problems at my place with locks caused by the code in an application. Took a lot of investigation to find the precise problem.

    It is locking multiple tables whenever we run a payment batch. I am waiting for the owners of the app to make the change.


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply