日期:2014-05-17 浏览次数:20426 次
ALTER FUNCTION IsPackInReplenish
(
@PromotorPackNo varchar(32),
@ReplenishID int
)
RETURNS BIT
AS
BEGIN
--DECLARE @PromotorPackNo varchar(32)
--DECLARE @ReplenishID int
--SELECT @PromotorPackNo='YP201401130000'
--SELECT @ReplenishID = 7
DECLARE @Result bit
-- 查找添补明细表中分包是否存在
DECLARE @ID int
SELECT @ID=ID FROM ReplenishItem WHERE (PromotorPackNo = @PromotorPackNo) AND (ReplenishmentID = @ReplenishID)
IF @ID>0
BEGIN
SET @Result = 1
END
ELSE
BEGIN
SET @Result = 0
END
RETURN @Result
END