Sql-server – Unable to trace “Arithmetic overflow error converting numeric to data type numeric” error in profiler

profilersql serversql-server-2008

I have a .net application. Its trying to create tables, views and insert/update data into many tables. while application running i got an error.

I tried to trace the query in SQL Profiler, but i didn't find any error. Is there any way to track the Error statement or Is there any other events i need to add in profiler.

I tried already following events (exception):

  • RPC: Completed
  • RPC: started
  • SP: started
  • SP: Completed
  • SP: Stmtstarted
  • SP: StmtCompleted
  • SQL: Batchstarted
  • SQL: BatchCompleted

Best Answer

Using the follow link you can set everything up to track the exception This link

In short: Set up a blank trace, add the following events :

  • Exception under Errors and Warnings
  • RPC: Completed under Stored Procedures
  • RPC: Starting under Stored Procedures
  • SQL: BatchCompleted under TSQL
  • SQL: BatchStarting under TSQL

From there on, you can see the error popping up in the trace, the query above the error will be your query that's giving the error.

If that's not giving you the exception, i'd debug the .NET code to get the SQL code that's being executed, if you have access to the source code.