Posted on: 5/6/2011 5:00:34 AM | Views : 222

Hello,
I have a unique situation were I have created a hierarchial formated datastructure in a SQL database using an adjency model.  My schema is as follows:

Using a datagrid to display this this table directly is not meaningful.  Creating this view makes it a bit more meaning: 
SELECT root.id, root.node_name AS root, parent.id AS parent_id, parent.node_name AS parent, dbo.core_Actions.id AS child_id, dbo.core_Actions.node_name AS child FROM dbo.core_Actions LEFT OUTER JOIN dbo.core_Actions AS parent ON dbo.core_Actions.parent_id = parent.id LEFT OUTER JOIN dbo.core_Actions AS root ON dbo.core_Actions.root_id = root.id

However root and parent nodes dont logically display as the "node lable" is alway under "child" column (renamed from node_name)
< ...

Go to the complete details ...