In the attached code, I am getting the error
Msg 8115, Level 16, State 2, Line 2
Arithmetic overflow error converting expression to data type int.
after getting the values for 20 rows.
are you able to get an idea which column gives the error with the error message?