I swear I had this working last night but perhaps I was only selecting one value when doing my testing. However, I'm receiving a subquery error when attempting to pass multiple values from a checkbox parameter to a sub report in an ajax tab. If I select only one value in the checkbox list, it works fine. I can see why this doesn't work but what's the solution to passing a comma separated list of values between reports based on an initial set of checkbox values? I also tried using 'in' but that didn't work.
Error:
Msg: message: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Example:
CREATE PROCEDURE sp_DBR_SummaryBacklog
@location varchar(200)
AS
BEGIN
declare @sql nvarchar(200)
create table #loc_tmp (
id int
)
select @sql = 'insert into #loc_tmp select t_location_id from [remote].[m1536_t].dbo.t_location where t_location_id in ('+@location+')'
exec sp_executesql @sql
select 'dbr.tab', 'Company Summary';
select 'dbr.tab', 'Location View', 'sp_DBR_LocationBacklog', location=(select id from #loc_tmp)