February 11, 2008 at 4:25 am
I need sql statement in sql server to print path between any of the two nodes.All node Elements and their respective parents are saved in a table.
Thanks in advance.
February 11, 2008 at 4:42 am
Without knowing the layout (DDL) of your tables, all I can say is
Use a CTE approach.
There are examples in Books Online how to use recursive cte.
N 56°04'39.16"
E 12°55'05.25"
February 11, 2008 at 2:07 pm
There are also many examples of resolving hierarchical data right in these forums. Search "hierarchy" in the forums and you'll find examples and discussions of them.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 11, 2008 at 6:15 pm
Hi,
Check out the below link,
http://www.sqlteam.com/article/more-trees-hierarchies-in-sql
Thanks -- Vj
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply