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