Arithmetic overflow error for select 2678400*1393 in SQL

4025 views sql-server
3

select 2678400 * 1393 

When I run this query, I'm getting this error in SQL Server:

Msg 8115, Level 16, State 2, Line 23
Arithmetic overflow error converting expression to data type int.

Please help me to resolve this issue.

answered question

1 Answer

12

Since this result overflows the capacity of INT - use BIGINT instead:

SELECT CAST(2678400 AS BIGINT) * 1393 

posted this

Have an answer?

JD

Please login first before posting an answer.