烙印99
/*获取两个数值的大小0:小于;1:大于;2:等于*/CREATE function GetMax(@qty1 varchar(50),@qty2 varchar(50))returns intbegindeclare @Num intif (convert(decimal(18,5),@qty1)-convert(decimal(18,5),@qty2) >0)beginset @Num=1endelse if (convert(decimal(18,5),@qty1)-convert(decimal(18,5),@qty2) <0)beginset @Num=0endelsebeginset @Num=2endreturn @Num