-- ================================================ -- Template generated from Template Explorer using: -- Create Procedure (New Menu).SQL -- -- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below. -- -- This block of comments will not be included in -- the definition of the procedure. -- ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: 曹嘉杰 -- Create date: 2022/8/30 -- Description: 查询分包的部件名称 -- ============================================= IF (EXISTS (SELECT * FROM SYS.OBJECTS WHERE NAME = 'SP_Cust_PDA_GetPartName')) DROP PROC SP_Cust_PDA_GetPartName GO CREATE PROCEDURE SP_Cust_PDA_GetPartName -- Add the parameters for the stored procedure here @BarCode NVARCHAR(500), @OrgCode NVARCHAR(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here DECLARE @OrgID AS BIGINT SELECT @OrgID = ID FROM Base_Organization WHERE Code = @OrgCode SELECT Segment80 AS PartName FROM BC_BarCode WHERE Code = @BarCode -- AND Org = @OrgID AND ISNULL(Segment78, 1) <> 1 END GO -- EXEC SP_Cust_PDA_GetPartName @BarCode = '11019999-00012-11000000051110-MO-110-2208300001-00001', @OrgCode = '110'