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 |
|
Cyclonik
Posting Yak Master
114 Posts |
Posted - 2001-12-14 : 21:04:41
|
| i am using this format to build a heirarchal menuWHILE @@ROWCOUNT > 0BEGIN SELECT @i = @i + 1 INSERT #MenuTable SELECT menu.item_id, sequence + right(convert(varchar(10),menu.item_id),10), @i + 1 FROM Menu, #MenuTable WHERE #MenuTable.levelNo = @i and menu.parent_id = #MenuTable.item_id and Menu.Active = 1ENDi need something like this out of it.. a variation on the sequence fieldthat looks like11_11_1_11_21_2_11_2_122_12_1_1if you get the picture any delimiter will suffice... . _ , whateverany ideas?i pull the data out of the temp table via:SELECT a.item_ID,a.LevelNO, b.parent_id, a.sequence, children_count=(select count(parent_id) from Menu where parent_id = a.item_id), (DATALENGTH(a.sequence)-10) as depth, b.name as Name, b.link as Link, b.group_idFROM #MenuTable a join menu b on a.item_id=b.item_id WHERE a.item_id = menu.item_id ORDER by sequenceChristian-=:SpasmatiK:=-Edited by - Cyclonik on 12/14/2001 21:07:56 |
|
|
|
|
|
|
|