34,590
社区成员
发帖
与我相关
我的任务
分享
CREATE PROCEDURE ItemImgBinarySUpdate
@ItemNo nvarchar(50),
@ImgBinary image=null,
@ImgBinary2nd image=null
AS
declare @RowC int
if @ImgBinary is not null
Begin
Update [ItemImgTB] Set ImgBinary=@ImgBinary Where ItemNo=@ItemNo
set @RowC=@@RowCount
End
if @ImgBinary2nd is not null
Begin
Update [ItemImgTB] Set ImgBinary2nd=@ImgBinary2nd Where ItemNo=@ItemNo
set @RowC=@RowC+@@RowCount
End
Select @RowC
GO
CREATE PROCEDURE ItemImgBinarySUpdate
@ItemNo nvarchar(50), --对应字段:ItemNo
@ImgBinary image=null, --对应字段:ImgBinary
@ImgBinary2nd image=null ,--对应字段:ImgBinary2nd
@n int output
AS
begin
if(@ImgBinary is not null and @ImgBinary is null )
begin
update ItemImgTB
set ImgBinary=@ImgBinary
set @n=1
end
else if(@ImgBinary is null and @ImgBinary is not null )
begin
update ItemImgTB
set ImgBinary2nd =@ImgBinary2nd
set @n=1
end
else if(@ImgBinary is null and @ImgBinary is not null )
begin
update ItemImgTB
set ImgBinary2nd =@ImgBinary2nd ,
ImgBinary=@ImgBinary
set @n=2
end
else
set @n=0
end