September 12, 2005 at 2:26 pm
I have a table that contains all the systems in my company. The requirement is that any system can relate to any other system. I created a system relation table that contains a relation id as the pk, the system id and the related system id. I now need to display a tree of the relations, and I'm not sure how to pull the data since the relations could run as deep as the number of systems. Is this a good design or could someone recommend a better table structure? Also, what is the best way to retrieve the hierarchical data?
September 12, 2005 at 2:47 pm
Check out Books online on Expanding Hierarchies:
BOL MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_5yk3.asp
This describes a way to retrieve data using a recursive model
Also Google search on "Trees in Sql" You;ll likely find an article by Joe Celko talking about "Trees" Or pick up Celko's book Sql for Smarties.
http://www.onlamp.com/pub/a/onlamp/2004/08/05/hierarchical_sql.html
The relationship for this data is not hard to store, but to retrieve is a little tricky, and to retrieve quickly is more trickier lol.
http://www.dbazine.com/oracle/or-articles/tropashko4
Butterfly in the sky, I can go twice as high Take a look, it's in a book - Reading Rainbow. I can go anywhere! Friends to know and ways to grow - Reading Rainbow. |
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply