Multi-Value Parameters and Stored Procedures

A multi-value parameter will be passed as a comma-delimited NVARCHAR string. Parse with string_split(@parametername, ',') which returns a table. If you want you strings to be INTs then do something like SELECT CAST(value AS INT) FROM string_split(@parametername, ',') You can use the SELECT in your WHERE clause, e.g. WHERE COLUMN_NAME IN ( SELECT CAST(value AS INT) FROM string_split(@parametername, ',') ) SQL Server Profile starts at 11:40

Comments