Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Tracing failed queries

Author  Topic 

unnoan2
Starting Member

2 Posts

Posted - 2012-05-01 : 11:29:07
Is there a easy way to perform a trace to capture data of a query that fails. I am usually left with thousands of lines when all I really want to know is which query failed. I am usually unable to even tell which one failed during the trace. Any help would be appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-01 : 12:30:39
Describe what you mean by "failed". Does it error on the client side?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

unnoan2
Starting Member

2 Posts

Posted - 2012-05-01 : 16:36:47
By failed I mean not complete. The application throws a object reference error basically saying that it was looking for something it can't find. If I had the actual query being executed I could find what is missing. The problem is I don't see the actual SQL statement that I can tell failed.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-01 : 17:08:01
The problem is that the SQL query probably didn't fail as it doesn't sound like you received an exception from SQL Server. I'm not a programmer though, so maybe someone else here can help you with this. I would guess that you'll need to add some debug code to your app to track this down. Sounds like maybe a Dbnull problem.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -