|
发表于 2020-11-11 12:15:01
|
显示全部楼层
declare @isWastage bit
declare @partcode varchar(20)
set @isWastage=1
set @PartCode='1234567890'
if @isWastage=1 --要求计算结果包含损耗
begin
if object_id(N'Tempdb..#TMP2') is not null dorp table #tmp2
select fpartcode, dosage INTO #TMP2 from tbom007d where fparentpartcode = @PartCode
end
else
begin
if object_id(N'Tempdb..#TMP2') is not null dorp table #tmp2
select fpartcode, dosage*2 INTO #TMP2 from tbom007d where fparentpartcode = @PartCode
end --这一行出错
|
|