Insert to table the picked multivalue parameters result.

  • Hi All,

    It was a while ago I used reporting services for reportings. So I obviously I could need some guidance to solve a reporting issue.

    I can't get the multivalue parameter report to save the picked filtered values down to a table. I need to make an INSERT of the resultset from what has been filtered out.

    So, I have ther 1’st dataset that is a storeprocedure that has the parameter @MultiVal that uses a splitfunction to parsing data based on what filters that has been picked. It calls the function in the where clause like so.

    where columnID in (SELECT Val from dbo.fn_String_To_Table(@MultiVal,',',1))

    The @multivalue parameter result shreds multiple columns column1, column2, column3..

    Then I have the 2’nd dataset that lists the id’s.

    Then I have the 3’rd dataset that is supposed to do the insert to the database. Like so:

    declare @MultiVal nvarchar(max)

    set @MultiVal= N'RESULT OF @MultiVal GOES HERE'

    insert into TABLE (column1,column2,column3,column4)

    EXEC sproc @MultiVal

    I get part of this report to work if I'm setting a hardcoded id value in the set@Multivalue ='00-00200-002'

    But I need this to pass thru the dynamic values from the picked parameter values. Anyone have any suggestions on how to do this? All efforts its much appreciated.

    Thanks in advance.

    /Rz

  • your current 'sproc' is:

    select column1,column2,column3,column4

    from TABLE

    where columnID in (SELECT Val from dbo.fn_String_To_Table(@MultiVal,',',1))

    you could make another stored procedure identical to 'sproc' but add insert into TABLE (column1,column2,column3,column4) to the query.

    insert into TABLE2 (column1,column2,column3,column4)

    select column1,column2,column3,column4

    from TABLE

    where columnID in (SELECT Val from dbo.fn_String_To_Table(@MultiVal,',',1))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply