[SQL] 纯文本查看 复制代码
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
IF object_id('dbo.CheckVendorContactExistsSP') IS NOT NULL
DROP PROCEDURE dbo.CheckVendorContactExistsSP
GO
CREATE PROCEDURE dbo.CheckVendorContactExistsSP(
@VendorNum VendNumType =NULL
, @Item ItemType
, @Infobar InfobarType OUTPUT
) AS
DECLARE @Severity INT
SET @Severity = 0
SET @Infobar = NULL
IF NOT EXISTS (SELECT 1 FROM item WHERE item = @Item ANDproduct_code in ('TOOL','Service','TRADE','ZB','FIXED'))
BEGIN
IF NOT EXISTS( SELECT 1 FROMitemvendprice where item = @Item ANDvend_num = @VendorNum)
SET@Severity = 16
END
RETURN @Severity
GO