Wednesday, September 22, 2010

SSRS. Must declare scalar variable @Parameter1

Well, one of the errors in Reporting Services 2005 says:

An error occurred during local processing
An error has occurred during report processing
Query execution failed for data set 'Name of the data set'
Must declare the scalar variable @Parameter1

This can be pretty annoying especially when you know you have the report parameter and it used to work. What happens is that, due to some black magic that I cannot explain, the data source is loosing the list of parameters. So the fix is to either add the parameters one by one or just delete and recreate the data source and everything will work.

2 comments:

Geeves00 said...

oh my god thanks you!!!!

Unknown said...

I just had the same issue with SSRS 2016, but the fix given above did not work. I had two parameters based on datasets. I could find no issues with the sql scripts despite extensive testing and debugging. The solution was to convert the scripts into stored procedures. Having only ever had the issue once so far, it may well be a rare problem.