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.
| Author |
Topic |
|
kiran.moily
Starting Member
2 Posts |
Posted - 2007-02-16 : 07:04:48
|
| Hi,We need to create a tree stucture output of a query.In case of Oracle , there is 'CONNECT BY' Clause for creating the same.Does SQL server support anything of this sort?If yes, can anybody please provide the syntax for the same?RegardsKiran |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-16 : 07:09:39
|
| No, there is not.Either do a recursice algorithm, or write a loop to iterate all nodes.Peter LarssonHelsingborg, Sweden |
 |
|
|
kiran.moily
Starting Member
2 Posts |
Posted - 2007-02-16 : 07:48:49
|
| Is there any other way in SQL Server to get a hierarchical output from a table where parent - child relationships are stored as below:Parent 1--------Child 1Parent 1--------Child 2Parent 1--------Child 3Child 1---------Child 11Child 1---------Child 12Child 2---------Child 21Child 2---------Child 22Child 2---------Child 23Child 2---------Child 24RegardsKiran |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-02-16 : 08:11:52
|
| [url]http://www.nigelrivett.net/SQLTsql/RetrieveTreeHierarchy.html[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|
|
|