SSRS Report Builder Part 11.5 - Multi Value Parameters and Stored Procedures

https://www.wiseowl.co.uk/report-builder/videos/report-builder-2016/multi-value-parameters-stored-procedures/

SQL Profiler starts around 12:28

Capture RPC Completed event; include TextData

You will see the multi-valued parameter passed to the stored procedure as N'(1,2,3) NVARCHAR comma-separated list

add WHERE clause to your query to parse the comma-delimited list:

WHERE Branch IN (

    SELECT CAST(value AS INT) as INTVALUE
    FROM STRING_SPLIT(@paramvalue, ',')

)

example:
@Branch parameter is NVARCJAR(MAX)

add WHERE clause:
where 
  bor.BRANCH IN (
SELECT CAST(value AS INT) AS Branch
FROM STRING_SPLIT(@Branch, ',')
)




Comments