• Jack Corbett: SSRS stores the names of the columns as part of the report definition (rdl file), that's the only way it can know what to display where in the report itself. So if you save the report with the columns FirstName, LastName, and BirthDate, those are the only columns the report itself knows about. SO if you change the parameter and the stored procedure now returns CompanyName, ContactName, PhoneNumber the report can't know about those columns because they are not stored in the report definition (rdl file). If I were doing this I would probably write the stored procedure so that it always returns ALL the columns. In my example I would always return FirstName, LastName, BirthDate, CompanyName, ContactName, PhoneNumber, but the unused columns would be NULL.

    Hi Jack,

    Returning all rows is just as muddy as using dynamic SQL which is the best way I've found to make this work. This procedure will be used for processes outside of reporting, so I need the output to be clean.

    My main gripe is that SSRS should see the output of the procedure, including parameters, and run with that instead of trying to get the column names from the procedure itself since the desired output wouldn't be known until it executes with parameters.

    Thanks for the reply and take care --

    Sam Alex