Sql-server – How to capture queries that fail on the SQL Server due to connection failures

sql serversql-server-2008

How can I capture queries that fail on the SQL Server due to connection failures?

Profiler doesnt seem to capture if there is a connectivity loss.

This is scenario:

  1. DB server running in Domain A
  2. SQL Client running on a server in Domain B – runs a transaction that would typically take 15 seconds to complete.
  3. Network connectivity breaks at 10th second between Domain A and Domain B
  4. SQL client displays error message – network failure
  5. Transaction not completed on the DB server. No records updated.

Best Answer

I believe you have to do this on application level and not on SQL Server.

Here is .NET way of inserting in to the event viewer: http://forums.asp.net/t/1503109.aspx/1