AndreAraujo
Programmer
Hi, i´m having some problems in a stored procedure.
i need to calculate a numeric value @parametro
i get Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int error when the stored procedure as to execute the calculation.
Any ideas ????
Thanks in advance
i need to calculate a numeric value @parametro
Code:
declare @parametro numeric (11,0) , @ano int
select @parametro=max(id) from tbl__cabecalho where id_lab=1
set @ano= (@parametro/10000000 )
if @ano = year(getdate())
begin
set @parametro =@parametro +1
end
else
begin
set @parametro=( ( (year(getdate()) +1 ) * 10000000) + (@id_laboratorio*1000000) + 1 )
end
Arithmetic overflow error converting expression to data type int error when the stored procedure as to execute the calculation.
Any ideas ????
Thanks in advance