日期:2014-05-18 浏览次数:20486 次
declare @next int declare @CurrentId int set @next=1 while @next<=dbo.Get_StrArrayLength(@ReterId,',') begin set @CurrentId=dbo.Get_StrArrayStrOfIndex(@ReterId,',',@next) INSERT INTO [L_ReterInfo]( [CreateTime],[UserProId],[ReterId],[Weight],[Status],[Remark] )VALUES( GETDATE(),@Id,@CurrentId,@ReterWeight,@Status,@Remark ) declare @nexts int declare @CurrentIdss int while @nexts<=dbo.Get_StrArrayLength(@ByReterId,',') begin set @CurrentIdss=dbo.Get_StrArrayStrOfIndex(@ByReterId,',',@next) INSERT INTO [L_ByReterInfo]( [CreateTime],[UserProId],[ReterId],[ByReterId] )VALUES( GETDATE(),@Id,@CurrentId,@CurrentIdss ) set @nexts=@nexts+1 end set @next=@next+1 end
declare @next int declare @CurrentId int declare @nexts int declare @CurrentIdss int declare @End1 int declare @End2 int set @next=1 set @End1 = dbo.Get_StrArrayLength(@ReterId,',') while @next<=@End1 begin set @CurrentId=dbo.Get_StrArrayStrOfIndex(@ReterId,',',@next) INSERT INTO [L_ReterInfo]( [CreateTime],[UserProId],[ReterId],[Weight],[Status],[Remark] )VALUES( GETDATE(),@Id,@CurrentId,@ReterWeight,@Status,@Remark ) set @nexts = 1 set @End2 = =dbo.Get_StrArrayLength(@ByReterId /*这在那里定义 赋值的?*/,',') while @nexts<=@End2 begin set @CurrentIdss=dbo.Get_StrArrayStrOfIndex(@ByReterId,',',@next) INSERT INTO [L_ByReterInfo]( [CreateTime],[UserProId],[ReterId],[ByReterId] )VALUES( GETDATE(),@Id,@CurrentId,@CurrentIdss ) set @nexts=@nexts+1 end set @next=@next+1 end