Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 two trips to sql server or one & query links sever

Author  Topic 

Nader
Starting Member

41 Posts

Posted - 2010-06-21 : 17:34:41
I have a huge table section
and other tables sectionquizquestion, sectionquizquestionans

is it better to retrieve section info in one trip
then go back and query the two other tables
or do it all once
i.e first trip get section info
second trip get questions and their answers

lazerath
Constraint Violating Yak Guru

343 Posts

Posted - 2010-06-21 : 17:54:19
I design data access methods to limit round trips to the database as much as possible. For instance, ASP.NET allows you to work with multiple returned recordsets. Just create a stored procedure to capture the results of your Section info query in a temp table or table variable, return the results and then use the temp table to join against the SectionQuizQuestion and SectionQuizQuestionAns tables.
Go to Top of Page
   

- Advertisement -