Capture an overflow error in a function
Posted on 2009-04-30
I am wondering what's a best way to capture/debug an error in SQL Server's 2005 function ?
I have the following query:
Select ID, dbo.fn_myfunction(id)
The query returns about 100 of expected 2000 rows and fails with the error:
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type money.
It's obvious that that error is somewhere in the custom function: dbo.fn_myfunction
What's the best and easier way to find where ?