Usher
Usher

Reputation: 2146

overflowed an int column. Maximum integer value exceeded

Am trying to execute this query but it doesn't like it"it throws the following exception "overflowed an int column. Maximum integer value exceeded." Not sure what am missing here

    select * from Schedwin.SEVT where 
ltrim(Resid)=345032 and type=5 or (type = 4 and subactid = 4)
or
(TYPE = 0)and (USER2='02-Force OT')
and ltrim(SEVT.t_start) <=  1215208800 
and ltrim(sevt.t_start) <=  1215207800
order by SEVT.TYPE

My bad, t_start data type is char so i modified my query like below and it works

    select * from Schedwin.SEVT where 
ltrim(Resid)=345032 and type=5 or (type = 4 and subactid = 4)
or
(TYPE = 0)and (USER2='02-Force OT')
and ltrim(SEVT.t_start) <= '1215208800' 
and ltrim(sevt.t_start) <= '1215207800'
order by SEVT.TYPE

Upvotes: 0

Views: 7691

Answers (2)

Iswanto San
Iswanto San

Reputation: 18569

The highest allowable INT value is 2,147,483,647. Check your t_start value if it exceeded allowable INT value

Upvotes: 1

Aniket Inge
Aniket Inge

Reputation: 25705

size of an integer is 4 bytes. You are trying to store more than 4 bytes in a column, overflowing it. Use bigint or nvarchar as the type for that column. :-) Alter the table.

Upvotes: 3

Related Questions