Hi , I am using Microsoft SQL Server , T-SQL please
Thank You
Main Topics
Browse All TopicsHi , I have a self join table
which 3 important columns
menuID, parentMenuID, menuName, menuDesription and other trivial fields
menuID, parentMenuID, menuName form the most important part of this .
menuID and parentMenuID are related
example entries
1, null, superParent
11, 1, firstparent
12, 1, secondParent
13, 1, thirdparent
111, 11, parent111
121, 12, parent121
so on , the list can be endless as the user has the freedom of increasing the tree horizontally and vertically upto any extent.
assume i would like to get all the menus under 11, as i said the menus can be increasd by the user vertically or horizontally as much as possible
please let me know how to write a sql query for this , also if you can write a LINQ query for this that will be great
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I beleive you need to take a look at http://msdn.microsoft.com/
Cheers, Andrew
Sharat it is sql server 2005, One more question , Do you have an idea of writing this in LINQ? Thats really what I want to do..
I thought , If no one can get this in LINQ , I will pass the SQL query via code instead of using LINQ objects
Meanwhile I will try on SQL Server 2005 and let you know how it works
I need to do this via code , Please help
Business Accounts
Answer for Membership
by: TextReportPosted on 2009-03-28 at 08:45:52ID: 24008885
Is this Oracle's PL/SQL or Microsoft Transact SQL that you want a solution
nology/pro ducts/orac le9i/daily / oct04.htm l
In Oracle you can use the CONNECTBY PRIOR
http://www.oracle.com/tech