【发布时间】:2014-07-07 09:32:12
【问题描述】:
我担心了一整天。 我的标签很大——“20317302009001”。 Zlecenie 是 int 列 - 因此 sql 在比较 zlecenie=@label 时会产生错误。 我试图抓住它,但仍然收到消息:
消息 248,级别 16,状态 1,过程 label_check,第 9 行 varchar 值 '20317302009001' 的转换溢出了一个 int 列。 谁知道答案? 谢谢!
begin TRY
if (@komponent is null) and ISNUMERIC(@label)=1
begin
set @komponent=null
if exists(select * from Rejestr_zuzycia_tkaniny where zlecenie=@label)
begin
declare @program int;
select @program=program from Rejestr_zuzycia_tkaniny where zlecenie=@label
select @komponent=komponent from Komponenty_programu where program=@program
end;
end;
end TRY
begin CATCH
set @komponent=null
end CATCH
【问题讨论】: