Skip to content
Advertisement

Sql arithmetic overflow

I have this query:

Insert into Course(name,age,id,facebookuser)
Values('Example',25,204813,blalbla@walla.com),
('Exmnumtwo',35,504813,email@walla.com)

Which gives me the error 8115: “arithmetic overflow error converting expression to data type int”.

However, when I delete the ‘,’ sign, everything works fine without any errors. What is causing the error?

Advertisement

Answer

based on the png you sent me http://up415.siz.co.il/up3/tm3jjmurzzmx.png

you need to make sure your IDs fit into the data size. Your actual data would overflow 32 bit signed integers, so you need to make your id type 64 bits (or 32 bit unsigned) or choose IDs that have smaller numbers like your example above which fails because you didn’t quote the email addresses.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement