Profiler Error data column
I run Profiler against my production Db to keep an eye on poorly performing t-SQL batches and SPs. There's an "Error" column in the profiler output. According to BOL (topic:Describing Events by Using Data Columns),Error = The error number of a given event. Often this is the error number stored in sysmessages.
The profiler output usually shows "0 - OK" in the error column. But it sometimes shows "1 - Error" or "2 - Abort" in this column. What do these error messages mean? I've looked around but haven't been able to find anything more detailed about what these two messages mean and how I can perhaps dig deeper to figure out what's going on. (When these values are displayed, CPU is usually taking a beating and the SPID runs this for at least 30 seconds before displaying information pertaining to this SPID).
Thanks much,
Smitha
By "event" I'm assuming you're referring to the Event Class Column.
For Error = 2 - Abort,
Event Class = RPC:Completed.
This was caused by a Stored Proc which accepts a SELECT query as an input parameter and performs another SELECT within the SP to return qualifying rows to the caller.
-
Thank you.
Thanks very much for your response. I do have a follow-up question:
What causes this SPID to be aborted or skipped? I included the error events in the profiler trace to see if I could find a line number that might be causing problems but this column is empty for rows with error = 2-aborted. Do you know of any documentation that addresses this topic?
Thanks again.
Abort could happen if the client cancelled the command or connection was terminated for example. You should probably add the Exception/Errorlog event also to look for any errors that might accompany the abort. Additionally, if you have some sort of logging/tracing in your application you can check for events around the same time as the RPC abort to find out the cause.