Search code examples
sql-serverlinq-to-sqlstored-procedureshigh-load

In Linq to SQL is it better return multiple results sets at once or call the DB using multiple stored procedures?


I am creating a very data intensive, high volume web site. Every aspect of the website is driven by interactions with the MSSQL DB that I am using. On one page there are 10-12 different resultsets that I need to utilize in my page. So I need to know the best practice when it comes to using Linq-to-SQL and multiple results sets with a web application.

Should I have it return multiple result sets, create classes that will then receive the data and utilize it that way or just call 10-12 Store Procedures and return the data to the previous generated LINQ To SQL Data Classes?

Thanks for your help everyone! I appreciate it!


Solution

  • Well as always the fewer trips to the database the better, but it all depends on whether or not that approach is maintainable and fits the architecture of your application. I personally have not worked on an application where the number of trips to the database was so important that I had to fetch everything up front, but each situation is different.