Viewing 6 posts - 1 through 6 (of 6 total)
mickyT, that's perfect. Thanks so much for your help!
March 11, 2013 at 5:54 am
mickyT, Thanks for your post. I see that your solution gives me what i need (not what i asked for, but perhaps better). How do a change...
March 10, 2013 at 6:25 pm
Uh... Grasshopper, I just realized your ID is not "Grasshopper". sorry about that.
March 10, 2013 at 12:22 pm
with cte as
(select MenuID,MenuDesc,ParentMenuID,Sequence, 1 as Lev
from Menu
where ParentMenuID = ''
UNION ALL
select m.MenuID,m.MenuDesc,m.ParentMenuID,m.Sequence,Lev+1
from cte
join Menu m
on m.ParentMenuID=cte.MenuID
)select MenuID,MenuDesc,ParentMenuID,Sequence,ROW_NUMBER()
over(order by Lev) as [Order],Lev
from cte
March 10, 2013 at 12:06 pm
A bit more invenstigation and i realized ParentMenuID was not null, but a zero-length string. so, changing to this give me a results. The Levels look good. ...
March 10, 2013 at 12:04 pm
Grasshopper: I'd a couple typos on my part on field names... i changed your query (below). When i run it now, i get no errors, but I also...
March 10, 2013 at 11:01 am
Viewing 6 posts - 1 through 6 (of 6 total)