How to find what database call is not in the transaction
I am experiencing a sql timeout in my .net code. If the past is any indicator, it is usually caused by a db call not being included in the transaction. What is a good way to determine (during run-time) what db call is not in a given transaction. Are there certain templates/settings I should use while running profiler (2005)? Would the activity log be best? I know what db call is failing, I just don't know what is causing the db call to fail.
How do most people figure this stuff开发者_如何学Go out?
Thanks!
Every SQL statement that executes on SQL Server will end up in a transaction - if there isn't an explicit one, an implicit one will exist.
In other words - there is always a transaction.
In regards to the problem - use the SQL Server Profiler - attach it to the server in question and trigger the behaviour that displays the problem.
The trace should show you all the relevant database events and let you troubleshoot the issue.
精彩评论