Showing posts with label OverflowException. Show all posts
Showing posts with label OverflowException. Show all posts

Monday, June 10, 2013

SQL Server Message 6260, system.overflowexception because of arithmetic overflow, error caused by divison by 0

One of my C# SQLCLR table valued function started to throw an exception with some recently added data to the database:

SQL Server Message 6260
system.overflowexception Arithmetic Overflow

How-i-fixed-it:
It turned out to be caused by a divison by 0 happening at runtime because of bad records in the data. I added some code to check for this which fixed the problem of the arithemtic overlow.