Hi Folks,
So I've created a Dynamic SQL query for WordFly Pages (Survey) results with column headings being the Questions and Answers that the kids over here come up with. They change for each different survey obviously.
Am I right in thinking that I can't run that as a Stored Proc to SSRS because the fields are ever changing? And if so will I have to run the Dynamic SQL as a Dataset Query in SSRS directly?Many thanks,
HeathAn eg: on one possible test output with 3 question fields
Heath Wilder said:Am I right in thinking that I can't run that as a Stored Proc to SSRS because the fields are ever changing?
Technically, yes, you can run dynamic SQL within a sproc, and send the output to an SSRS report, but it's usually a fiddly process, e.g. either decide you don't care how many output columns you have, and send the data to a matrix, or decide a maximum number of output columns that you will never exceed, create a matching output table in the report, and hide the ones you aren't using for this particular run, or the like. Not very elegant, but it can be done.