Sunday, March 25, 2012

Binary Tree Problem in SQLServer

Hi Members
I m new in this forum, I have have Binary Tree database in SQL Server with
table fields(Mcode,Mname,LeftMCode,RightMCode). i want to display downline and pairs of each member.
can any one help me out?
Regards
Amirbkkread this.
is for OLAP, but, maybe help you.

http://www.codeproject.com/cs/database/tree_olap.asp|||From your column names, I'm guessing your are dealing with a Nested Set model ala' Joe Celko, rather than the more common Adjencency Model.
You should be able to find some code samples here:
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=1266295
...or by googling "Celko Nested Sets".|||Thanx for reply

But i have little prob that all nodes will be freely put on any side means any member can be put on left or right side and my db will grow very fast and estimated records will be more than 100000 with in few months

so if i use lineage and depth methods can i store path in one fields
and if use set model than i think , left node must be fill first and right node must be +1 than its left node.
and in my db any node(member) should be put on any side

so guys and suggestion will be higly appreciated.
i m going to build db with in few days , plz help me out.

Regards,

Amir|||Thanx for reply

But i have little prob that all nodes will be freely put on any side means any member can be put on left or right side and my db will grow very fast and estimated records will be more than 100000 with in few months

so if i use lineage and depth methods can i store path in one fields
and if use set model than i think , left node must be fill first and right node must be +1 than its left node.
and in my db any node(member) should be put on any side

so guys and suggestion will be higly appreciated.
i m going to build db with in few days , plz help me out.

Regards,

Amir

No comments:

Post a Comment