开发者

How to pass multi-valued parameters in stored procedure in SSRS [duplicate]

This question already has answers here: Closed 10 years ago.

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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜