Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 manage Referrals Zone wise

Author  Topic 

mrtanvirali
Starting Member

41 Posts

Posted - 2010-03-04 : 13:00:29
hello,

I am working on MLM type application, In this I've 4 Zones i.e
L zone, I zone, N zone and X zone,
zone will change after every 4th referral e.g. in L zone user have 3 referrals as he will refer 4th referral he'll move to I zone.

My question is how can i manage / store referrals? to find out that a user has referred to Mr. ABC in ? zone (whether L zone, I zone, N zone and or X zone)

curently i've
user information (userid, name, email and some other info) and
user_referral_Mapping (userid, parentid, depth, lineage)
quote:
I am following
http://www.sqlteam.com/article/more-trees-hierarchies-in-sql
after reading the following link
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=2828

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2010-03-05 : 07:36:34
triggers?
on adding a new referral, count number of total/existing referrals and conditionally execute an update of the existing customer status?
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2010-03-05 : 13:13:57
thanks Andrew,

that's what i want to do but not getting the point how to store the customer status,
I've update the zone status who is refering but want to update the status who is being referred.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-05 : 13:17:29
you mean you want update status of parent user?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2010-03-06 : 03:49:20
no, i want to update the status of child users, e.g.

If I am the parent user and i've referred 4 users in 1st Zone,
and after that i moved to 2nd Zone and there i also referred 3 users and so on,

now i want to know that which users fall in 1st Zone and which one users fall in 2nd Zone.
Go to Top of Page
   

- Advertisement -