Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Arithmetic overflow in SQL server 6.5

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-31 : 09:42:56
Marc writes "I am creating a stored procedure to verify that a customer number is valid. The number is valid if the first ten digits mod 7 equals the last digit.

example: 24000141476 is the number
2400014147 % 7 = 6 so the number is valid

The problem is that the number I show above causes an Arithmetic overflow since it exceeds that maximum size of an integer and modulus only works with the integer data type. I have to follow this procedure so I need to know if there is some math or SQL trick to get around this problem. I am using SQL server 6.5 service pack 5 on Windows NT 4.0 service pack 6."
   

- Advertisement -