Kieran Senior
Kieran Senior

Reputation: 18220

Is LINQ slower than calling stored procedures?

I'm hoping that we will be overhauling our system to use ASP.NET MVC, however all of the examples provided tend to use LINQ to SQL. We were told by a LINQ developer than it is actually slower than calling a store procedure.

Furthermore, how would you call a stored procedure for output using MVC? I'm not entirely sure LINQ would meet our needs as our stored procedures are extremely large, and complex. Any thoughts?

Upvotes: 1

Views: 1165

Answers (3)

Gustavo
Gustavo

Reputation: 359

You can in fact call stored procedures from Linq to SQL. Take a look at this: http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx I'd argue there is no performance drop in using Linq as it is simply a way to express your sql code in C#/VB.NET. It will get translated into plain sql. This is the old fight of Stored Procedures VS normal queries, Linq is not really a part of the question.

Upvotes: 9

Kazi Manzur Rashid
Kazi Manzur Rashid

Reputation: 1544

Yes it is slower in certain edge cases, in those cases you can call the sprocs from L2S.

Upvotes: 3

Steven
Steven

Reputation: 3928

I believe that LINQ to SQL has been deprecated and LINQ to Entities is the tech to use.

Upvotes: 0

Related Questions