日期:2014-05-18 浏览次数:20528 次
CREATE proc test @param1 smallint , @param2 varchar(14), @param3 smallint, @param4 Varchar(50) as begin if (select * from comProd where flag=isnull(@param1,'')and billNO=isnull(@param2,'')and RowNO=isnull(@param3,'') =1) then update comProd set UDEF1= @param3 where where flag=isnull(@param1,'')and billNO=isnull(@param2,'')and RowNO=isnull(@param4,'') else return end GO
------解决方案--------------------
create proc test @param1 smallint, @param2 varchar(14), @param3 smallint, @param4 Varchar(50) as begin if ((select count(1) from comProd where flag=isnull(@param1,'')and billNO=isnull(@param2,'')and RowNO=isnull(@param3,''))=1) update comProd set UDEF1= @param3 where flag=isnull(@param1,'')and billNO=isnull(@param2,'')and RowNO=isnull(@param4,'') end