ALTER PROCEDURE [dbo].[sp_PairMatch] ( @sponcorid varchar(50)= NULL, @count_mem varchar(50)= NULL, @regCode varchar(50)=NULL ) AS BEGIN --Pair Matching SET @count_mem=0 WHILE(@sponcorid is not null) BEGIN SET @count_mem = (select Count(*) from Registration_Master where sponcorid=@sponcorid) IF(@count_mem=1) BEGIN return END IF(@count_mem = 2) BEGIN DECLARE @persent_Count int SET @persent_Count = (Select count_mem from Registration_Master where regCode=@sponcorid) SET @persent_Count=@persent_Count+1 UPDATE Registration_Master SET count_mem=@persent_Count where regCode=@sponcorid DECLARE @temp varchar(50) SET @temp=@sponcorid set @sponcorid = (SELECT sponcorid from Registration_Master WHERE regCode=@temp ) -- IF((@count_mem >=20) AND (@count_mem<40)) -- BEGIN -- UPDATE Registration_Master SET @member_status='MANAGER' where sponcorid=@sponcorid -- END END END END SELECT * FROM Registration_Master WHERE regCode=@regCode
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)