• clayman (8/18/2014)


    Thanks for your response.

    The result sets returned for those data sets are different (number of columns returned / data types) so not sure if it's possible to do this in one data set. The SELECT INTO query at the top is a massive one touching 15-20 tables / views and although it is optimized I wouldn't want it to run 10 times. Any other ideas? Thank you for your time.

    The only way I know of to do it in one call is how I already posted. You need to return all the data to the report in one data set and then use that one data set (with filters) for each data region. You only have to use the columns you need for that data region.

    I wouldn't design the solution this way. I'd have a specific query/SP for each data set that is optimized for that data set instead of using a catch-all query to populate a temp table and then returning different data for each data set based on a parameter passed in. The temp table is being created and load for each of the 10 data sets. The only way I'd use a "temp table" like this is if I could have a job that pre-populates a permanent table once a day and then just query that permanent "temp" table in each of the data sets for the report.