Use [btarndata]go/****** object:storedprocedure [dbo]. [Proc_getactivitystatus] Script date:09/16/2015 16:16:02 ******/set ansi_nulls ongoset quoted_identifier ongoalter PROCEDURE [dbo]. [Proc_getactivitystatus] (@PIPCode varchar, @PIPVersion varchar, @PIPInstanceID nvarchar (255), @SourcePartnerName nvarchar (255), @ Destinationpartnername nvarchar (255), @IsInitiatorActivity bit) ASIF (@DestinationPartnerName = ' seagate-amk ' and @ Pipcode = ' sg_3b2 ') begin SET @PIPCode = ' 3B2 ' ENDIF (@DestinationPartnerName = ' seagate-us ' and @PIPCode = ' sg_3b2 ') begin S ET @PIPCode = ' 3B2 ' ENDIF (@DestinationPartnerName = ' SEAGATE-USML ' and @PIPCode = ' sg_3b2 ') BEGIN SET @PIPCode = ' 3B2 ' ENDIF (@DestinationPartnerName = ' Seagate-amk ' and @PIPCode = ' sg_4b2 ') Begin Set @PIPCode = ' 4B2 ' ENDIF (@DestinationPartnerName = ' seagate-us ' and @PIPCode = ' sg_4b2 ') begin set @PIPCode = ' 4B2 ' ENDIF (@DestinationPartnerName = ' SEAGATE-USML ' and @PIPCode = ' sg_4b2 ') BEGIN SET @PIPCode = ' 4B2 ' END DECLARE @sourcePartn ErkEY int DECLARE @destinationPartnerKey int DECLARE @ActivityID nvarchar (255) Set @sourcePartnerKey = '-1 ' set @destination Partnerkey = '-1 ' Select @sourcePartnerKey = Partnerkey from Partnerlookup WHERE [email protected] Select @destinatio Npartnerkey = Partnerkey from Partnerlookup WHERE [email protected] SELECT TOP 1 currentstatus from activitytracking Tblat WHERE Tblat.pipcode = @PIPCode and tblat.pipversion = @PIPVersion and Tblat.pipinstanceid = @PIPInstanceID and Tblat.sourcepartnerkey = @sourcePartnerKey and Tblat.destinationpartnerkey = @destinationPartnerKey and Tblat.isini Tiatoractivity = @IsInitiatorActivity
Use [btarnconfig]go/****** object:storedprocedure [dbo]. [Gettpaconfigdata] Script date:09/16/2015 16:47:17 ******/set ansi_nulls offgoset quoted_identifier ongoalter PROCEDURE [dbo]. [Gettpaconfigdata] (@PIPCode Char, @PIPVersion char, @HomePartnerName nvarchar (255), @TradingPartnerName nvarchar (255), @ Ishomeroleinitiator tinyint) as DECLARE @homePartnerKey int DECLARE @tradingPartnerKey int set @homePartnerKey = '-1 ' Set @tradingPartnerKey = '-1 ' Select @homePartnerKey = Partnerkey from Partnerlookup WHERE [email protected] Select @tra Dingpartnerkey = Partnerkey from Partnerlookup WHERE [email protected] if (@homePartnerKey = 1 and @HomePartnerName <> ") BEGIN INSERT into Partnerlookup (partnername) VALUES (@HomePartnerName) SELECT @homePartnerKey = @ @IDENTITY E ND if (@tradingPartnerKey = 1 and @TradingPartnerName <> ") BEGIN INSERT into Partnerlookup (partnername) VALUES (@ Tradingpartnername) SELECT @tradingPartnerKey = @ @IDENTITY ENDIF (@TradiNgpartnername = ' Seagate-amk ' and @PIPCode = ' 3B2 ') BEGIN SET @PIPCode = ' sg_ ' + @PIPCodeENDIF (@TradingPartnerName = ' Seag Ate-us ' and @PIPCode = ' 3B2 ') BEGIN SET @PIPCode = ' sg_ ' + @PIPCodeENDIF (@TradingPartnerName = ' SEAGATE-USML ' and @PIPCode = ' 3B2 ') begin set @PIPCode = ' Sg_ ' + @PIPCodeENDIF (@TradingPartnerName = ' Seagate-amk ' and @PIPCode = ' 4B2 ') begin set @P Ipcode = ' Sg_ ' + @PIPCodeENDIF (@TradingPartnerName = ' seagate-us ' and @PIPCode = ' 4B2 ') BEGIN SET @PIPCode = ' sg_ ' + @PIPC Odeendif (@TradingPartnerName = ' SEAGATE-USML ' and @PIPCode = ' 4B2 ') BEGIN SET @PIPCode = ' sg_ ' + @PIPCodeEND SELECT tc.* From Tpaconfig TC, pipconfig pc WHERE @PIPCode = pc. Code and @PIPVersion = pc. Version and @homePartnerKey = TC. Homepartnerkey and @tradingPartnerKey = TC. Tradingpartnerkey and pc.id = TC. Pipid and @IsHomeRoleInitiator = TC. Ishomeroleinitiator and Status = ' 1 ' ORDER by TC. Name
BizTalk RosettaNet Custom PIP code