2

Possible Duplicate:
SSRS multi-value parameter using a stored procedure

How do you pass multi-valued parameters into a stored procedure in SSRS? Please provide an example query or steps.

0

1 Answer 1

2

Create a parameter in your stored procedure that accepts text to handle the multiple values.

You will need to use the IN keyword, and in order to do this you will be required to perform dynamic SQL inside the stored procedure.

A multi-value parameter coming from SSRS containing 3 search values will look something like this '1,2,344'.

CREATE PROCEDURE GetRecords @CustomerId nvarchar(50) AS

Declare @sql nvarchar(max)

Set @sql = 'Select * From Customers Where CustomerId IN (' + @CustomerId + ')'

exec sp_executesql @sql

Not the answer you're looking for? Browse other questions tagged or ask your own question.