You are here: Re: Rendering directory structures « MsSQL Server « IT news, forums, messages
Re: Rendering directory structures

Posted by Ben on 11/01/05 02:55

Hi Erland,
Thanks a lot for your reply.

First off, thanks for reminding me about the "sp_," it's a very bad
habit my company has gotten me into, and I am trying to break out of
it.

I applied your algorithm to some test data and it yielded the record
set in a breadth first manner, which could be very useful, however I
would like to render the folders in a depth first manner.
For example, if I had the simple tree:
A:-->B,C; B:-->D; C-->E;
+------------------------+
|folderid| parent| name |
+------------------------+
|1 | Null | A |
|2 | 1 | B |
|3 | 1 | C |
|4 | 2 | D |
|5 | 3 | E |
+------------------------+

Then I would want to display it in the following order:
A,B,D,C,E.

That would visually be:
A
B
D
C
E
Rather than:
A
B
C
D
E

I have tried to construct some way to join the two tables (#tmp and
Folders) together to achieve this result, but I have been unable to
come up with anything so far, besides my original post.

Please let me know of any ideas you have.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация