Why isn't SP returning correct range of fields to Dataset

  • I've got a data source that I will need to use as the basis for some 12 to 15 reports and because the table is quite large (several million rows and over 50 columns), I created a SP that given a passed parameter, will return filtered datasets of varying numbers of rows and columns specific to the requirements of each report.

    So I thought that for each separate report, I could create a Report Parameter, set it equal to the default value of the result set I wanted to return and then pass that value to a single Shared Dataset.

    The problem is that when I create a Shared Dataset in SSRS (R2) and attempt to execute the SP with the passed parameter, I can't seem to get the SP to return the different datasets (it returns the same dataset regardless of what I've set the parameter to), even if I replace the parameter with the actual value of the result set I want returned.

    I've set the parameter value every place I can think of (Report Data Parameter, Report Data Dataset, Solution Shared Dataset) but nothing seems to change the dataset that's returned when I refresh the Shared Dataset.

    I've also tried using an embedded dataset rather than the Shared Dataset but the same issue persists, I can't get the correct set of fields to return when I refresh the data, even though the SP works without issue when executed in a query window ...

    :crazy:

    [edit] In a more general sense, I guess I'm asking, "what exactly happens when I hit 'Refresh Fields' in Dataset Properties when I'm using a dynamic SP"?

  • Maybe BIDS is using cached data when you run the report.

    Make sure all the .data files are deleted before you run the report again.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Unfortunately, that's one of the first things I tried.

    Here's the thing though (and this is the reason I added the [edit]), refreshing the fields for a Report dataset (that doesn't have a .data file already created) doesn't create a .data file. So what *does* happen when I refresh the fields? It obviously compiles and evaluates the SP in some fashion, since it does return the list of fields from one of the queries in the SP (specifically #3) ...

  • swhedges47 (3/20/2013)


    Unfortunately, that's one of the first things I tried.

    Here's the thing though (and this is the reason I added the [edit]), refreshing the fields for a Report dataset (that doesn't have a .data file already created) doesn't create a .data file. So what *does* happen when I refresh the fields? It obviously compiles and evaluates the SP in some fashion, since it does return the list of fields from one of the queries in the SP (specifically #3) ...

    I once had a strange report with shared datasets that only "refreshed" everything when I deployed it to the server.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply