I have a table with approx 3000 records which I need to export to csv (through a .net Web application) however I also need to pull information from about 10 other tables (also about 3000 records each) so that the form more columns, e.g.
Individual Table Organisation Table IndividualOrganisation Table
Output: Individual.Name, Organisation.Name
Currently I am using a stored proceedure to create a temporary table with the extra columns (e.g. one for Organisation.Name etc...) then doing queries one after another from the other 10 tables to bring the information in. This causes timeout period elapsed errors on sql connection even if I extend the time to 200!
Would it be better to construct a massive single sql statement in my stored procedure and execute it. These 10 tables that are 'joined in' are conditional on user selection fo stored procedure currently has sequence of ifs then selects