Radius: Arithmetic overflow error converting expression to data type int
Problem Summary:

Problem: The Event Viewer and VOP Radius error log "VPRError.log" shows the following error:

VPR Radius Server Error: ODBC Error: State:22003, Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error converting expression to data type int.



First, it is important to understand that the source of the error is from the SQL Server / ODBC Driver and VOP Radius is only reporting it in the logs. Second, this error is most likely to happen only with accounting data since with authentication only a SELECT statement is performed. Third, the error means that there is a mismatch somewhere in one the fields between what VOP Radius is sending, via an INSERT statement, and what the SQL Server Table Field is set to support. For example, VOP Radius, via an INSERT statement, may be sending an INT value, but the SQL Server Table field accepting that field may be set to only accept TINY INT values. Fourth, in this problem it is important to understand that the data VOP Radius receives, and subsequently sends to the SQL Server Table, is actually originally sent by the Network Access Server (NAS). That is, the Network Access Server sends to VOP Radius the accounting data, VOP Radius in turn takes this accounting data "as is" and sends to the SQL Server Database Table configured under the Accounting --> ODBC Setup section.




 The difficulty with this error is that it not does narrow down the exact field (or fields) where the mismatch exists. For this reason, the administrator may need perform some guess work to find the problem. Here are some recommended troubleshooting steps:

1) Enable full log tracking in VOP Radius
2) Find the error in the VOP Radius error log "VPRError.log"
3) Examine the query for values that stand out as "large"
4) Using the SQL Query determine the field name where these "large" values are destined to be inserted
5) In the SQL Server Table look at the data type set for the field
6) Increase as necessary the data type size for the field

Note: The above troubleshooting steps take the viewpoint that what the Network Access Server is sending is correct. It may also be the case that a problem with the Network Access Server is causing it to send incorrect and inflated values. In this case the administrator may take troubleshooting steps focused on on the values that the Network Access Server is sending rather than try to compensate for the problem by changing the Data Type in the SQL Server Table field.

Related Information: