Suppose the company ids are coming in a string name @COMPANY_ID
BEGIN DECLARE @CID VARCHAR(70) DECLARE @Id varchar(max) declare @Idd varchar(255) declare @PN varchar(255) declare @PNN varchar(255) SET @CID = CONVERT(VARCHAR,@COMPANY_ID) SET @PNN='' Declare @CommaIndex varchar(10) set @Idd=@search_key+',' While( @Idd <> '' or @Idd <> null ) BEGIN SELECT @CommaIndex = PATINDEX('%,%', @Idd) Select @PN = Substring(@Idd,1,@CommaIndex-1) set @PN=+ ''''+ ''+ @PN +'' +''''+',' set @PNN=@PNN+@PN Select @Idd = Substring(@Idd,PATINDEX('%,%', @Idd)+1 ,len(@Idd)) if(@Idd is null) begin break end
|
No responses found. Be the first to respond and make money from revenue sharing program.
|