4

we got some connections timeouts running a stored procedure in a SQL Server 2008 instance. after a while, the DB started to work as usual, and there weren't any additional timeout errors.

So I'm trying to get additional info about the error.

Does SQL server 2008 have any kind of error log that I can look into?

Do exist any auditing/logging features that I can activate to trace the error (if it happens again)?

2
  • Can you post the exact timeout error? It may be the client setting for query timeout. Jul 16, 2010 at 13:53
  • The application that got the timeout exception do not generate logs. so I have to review the SQL server logs
    – SDReyes
    Jul 16, 2010 at 16:45

3 Answers 3

2

To see the SQL Logs: Connect to your SQL instance via Management Studio, expand the Management folder in the object browser, expand the SQL Server logs folder and you can examine your logs.

Default behavior is to keep six logs with a new one being created each time the database engine server is restarted.

Profiler can always be used to see what is happening under the covers.

You might post the messages associated with your timeout...

4
  • @jl: Thank you jl, exactly was I was looking for. The application that got the timeout exception do not generate logs. so I reviewed the SQL server logs, but there isn't any error logs around the exception. I would trace it using the profiler if it happens again. +1 : )
    – SDReyes
    Jul 16, 2010 at 16:44
  • except you can't trace with profiler after the fact, you have to have it running when the error happens.
    – SqlACID
    Jul 16, 2010 at 23:54
  • And te SQL Server logs will not record application level timeouts
    – TomTom
    May 28, 2014 at 9:23
  • Viewing the SQL Server Error Log will not help with identifying the root cause of client timeout errors and as such, the "chosen" answer is a little misleading. May 28, 2014 at 9:24
1

SQL Server logs won't capture application timeouts, as they are generated by the client code, not the SQL Server.

To capture long running queries, you need to use SQL Profiler. Setup a trace which captures all commands which take over 30 seconds (the default .NET timeout) and see what comes up.

That or put code in the application so that when it gets a timeout it logs some data about the query that it was running, and the failure reason.

0

The currently selected answer is slightly misleading as it discusses referencing the SQL Server Error Log, which will not help for the given scenario.

As mrdenny quite rightly points out.....

Application timeouts to SQL Server are initiated from the client-side as Attention Events and are not recorded in the SQL Server Error Log.

You can monitor for Attention Events using:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.