| Author |
Topic |
|
obscure
Starting Member
6 Posts |
Posted - 2009-11-18 : 10:39:29
|
| Hi all.I have an application which inserts a new row into a table. If this insertion fails, the query is stored in a log file. The problem is, the inseriton is failing form time to time, without any signs. If i take the query from the log file and run it from the query manager, it succeeds.I have no way of knowing what the error message of the failed insertion is from the application, so i was wondering if there is a log in the database i can search. Is it possible to create a transaction log and check in it for failures?Using the profiler is not an option, as it will slow down the system, and the operations are time critical.Thanks for you help. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-18 : 10:43:52
|
| if this is a homegrown app, have the application log the exact errora narrow, focused trace won't slow down the system too much if you have some idea of what you're looking for. but if the app was logging the error it'd be real easy :) |
 |
|
|
obscure
Starting Member
6 Posts |
Posted - 2009-11-18 : 11:59:12
|
| Can I use the profiler to monitor a specific table only? If so, will it affect the performance less than monitoring the whole database? |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-18 : 12:12:52
|
| yes and yes |
 |
|
|
obscure
Starting Member
6 Posts |
Posted - 2009-11-18 : 12:23:12
|
| Ok, how?I searched the web but really couldn't find anything i could make sense of. |
 |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2009-11-18 : 15:21:39
|
quote: Originally posted by obscure Ok, how?I searched the web but really couldn't find anything i could make sense of.
I don't think you can trace a specific table.But you can trace a specific Stored Procedure: - On the events, select all events for the event group 'Stored Procedures' - For the Column filtes, the filter is 'ObjectName', put the Stored Procedure name there and check the 'Exclude Rows...' |
 |
|
|
obscure
Starting Member
6 Posts |
Posted - 2009-11-18 : 15:28:12
|
| And can I see what the returned execution error is? |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-18 : 16:24:20
|
| you can filter for all procs known to touch the table in question and all SQL batches where text like table in questioncan find which procs touch it in information_schema.routines or syscomments views |
 |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2009-11-19 : 12:08:18
|
quote: Originally posted by russell ... and all SQL batches where text like table in question
Ah... Thank you. |
 |
|
|
obscure
Starting Member
6 Posts |
Posted - 2009-11-21 : 05:29:19
|
quote: Originally posted by denis_the_thiefI don't think you can trace a specific table.But you can trace a specific Stored Procedure: - On the events, select all events for the event group 'Stored Procedures' - For the Column filtes, the filter is 'ObjectName', put the Stored Procedure name there and check the 'Exclude Rows...'
Ok, i did just this, but don't see the error message returned anywhere. How can i see what the returned result is... success or failure. |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-21 : 10:03:37
|
| http://blogs.sqlserver.org.au/blogs/greg_linwood/archive/2006/03/29/70.aspx |
 |
|
|
nalnait
Starting Member
14 Posts |
Posted - 2009-11-22 : 04:20:51
|
| u can use try...catch |
 |
|
|
|