I am looking to perform a recursive query to a sql server 2008 database to solve a bill of materials / adjacency list problem. I am debating whether to use linq or a stored procedure. I dont have any experience with linq. Does linq support recursive queries?
Can you provide some recursive linq code so i can see how i would structure such a query? Would a stored procedure be vastly quicker and a lower load on the server than linq? Are there any alternative methods you would recommend or which you think i should
explore? Many thanks.
Hard to say with out knowing the specifics of the database. In general if you are joining to more than one table I would use a stored procedure. You can call a stored procedure with linq to sql and the entity framework.
MangoMM
Member
65 Points
55 Posts
Bom problem - linq vs stored procedure
Mar 14, 2012 08:55 AM|LINK
Ken Tucker
All-Star
16797 Points
2608 Posts
MVP
Re: Bom problem - linq vs stored procedure
Mar 14, 2012 10:48 AM|LINK
Hard to say with out knowing the specifics of the database. In general if you are joining to more than one table I would use a stored procedure. You can call a stored procedure with linq to sql and the entity framework.
Space Coast .Net User Group
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Bom problem - linq vs stored procedure
Mar 16, 2012 01:35 AM|LINK
Hello MangoMM:)
For recursive LINQ,I think you can see this:http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/fe3d441d-1e49-4855-8ae8-60068b3ef741/