I have this query executing in client side
select *
from orders
where orderid > @id and orderid < @id + 1000
Now the @id value is 2147483647 and I'm getting this error:
I tried to cast and convert like below
select *
from orders
where orderid > @id and orderid < cast(@id + 1000 as bigint)
but no luck.
Is there a way to cast/convert the addition into bigint in the where condition?
Thanks

@idtobigint. But I think that you also can do like thiscast(@id as bigint) + 1000