How to send a multi-valued Reporting Services parameter to a SQL Server function?

I have a report that uses a multi-valued parameter in the expression "in" in the request. For example (with the @areas parameter as a multi-valued parameter):

select * from regions where areas in (@areas)

It works fine, but now I need to send the same function parameter to the SQL Server 2005 database:

select name, myFunction(@areas) from regions where areas in (@areas)

The @areas parameter in the function will also be used in the "in" statement. I tried to get it with the varchar parameter, but that causes an error. When I use SQL Profiler, I see that this parameter is passed in this format:

N''1'',N''2'',N''3''

The specific questions are: what data type should be the parameter of the @areas function? And how can I use this parameter in an in expression in a function?

thanks

+3
3

, - , varchar , . XML, varchar .

+2

sql 2008, , , . - ( varchar xml), , temp. , temp, , , . - xml (.. - , , facebook), xml. int, , , .

+1

Source: https://habr.com/ru/post/1709861/


All Articles