FTeR
FTeR

Reputation: 11

Slow SP call through LINQ or SqlCommand, but not with EXECUTE

I have a fairly complex Strored Procedure in MS SQL Server, which queries large database. I done many optimization, so when I call it with EXECUTE from SSMS it runs under 1 sec, witch good enough.

Problem is when I call it from ASP.NET 3.5 using LINQ or SqlCommand it takes several minutes on the production server, while the server load is not even high.

I think it has something to do with the configuration, bec the development server runs as expected.

The production server has SQL Express 2008 sp2, the development server has SQL Express 2005. My dev machine has SQL Express 2008 R2 and performs well.

What/where should I check?

ty!

Upvotes: 1

Views: 338

Answers (1)

Francis Gilbert
Francis Gilbert

Reputation: 3442

Check this with SQL Profiler. LINQ to SQL will most probably suffer from the Select n + 1 issue.

Have a quick look here for that: http://l2sprof.com/Learn/Alerts/SelectNPlusOne

Upvotes: 1

Related Questions