There was also an article in a CFDJ in days done by which covered this in cfml/SQL - have a look at the archive and see what you can find.
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -----Original Message----- From: Antony Sideropoulos To: SQL Sent: Tue Nov 14 23:40:47 2006 Subject: Re: Recursion in SQL ??? I just read a great article on this (found via fullasagoog): http://www.sitepoint.com/article/hierarchical-data-database Don't be put off by the 'php/mySql' tag - the concepts apply to this situation perfectly. The article covers the 'Adjacency List' and 'Modified Preorder Tree Travel' models. HTH Antony On 11/15/06, Duane <[EMAIL PROTECTED]> wrote: > > Is it possible to create a recursive query in SQLServer? > > I have a table that contains a parent/child record relationship and I want > to build a tree without client side processing. > > ID Parent > 1 Null > 2 1 > 3 Null > 4 2 > 5 1 > 6 Null > 7 2 > 8 6 > > Needs to be sorted as > -1 > - 2 > - 4 > - 7 > - 5 > -3 > -6 > - 8 > > > TIA, > Duane > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2627 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
