I'm having trouble creating a dataset in Reporting Services 2008. Here's the query I want to use (generic-ized for public consumption):
Declare @PersonID as int
set @PersonID = (select top 1 personID from People where name = @PersonName)
select (some columns)
from [otherTable]
where personID = @PersonID
I only have one input parameter: @PersonName
. However, Studio 2008 seems to think @PersonID
also needs a value in the "Define Query Parameters" window. So when I try to only enter a value for @PersonName
, it gives me the "This variable has already been defined".
I'm passing @PersonName
because I need to display a human-readable list of the people to select from a dropdown as the only user-facing parameter to the report. I realize I could do a subquery and forget the variable in the above example, but my real query is much larger/uglier, and I can't exactly add indices to the data tables, so I'd like to limit the table scans.