Hi, I have a report that use a multi-value parameter into a "in" statement in a query. For example (with @areas as the multi-value parameter):
select * from regions where areas in (@areas)
It works perfectly but now I need to send the same parameter to a function in the SQL Server 2005 database:
select name, myFunction(@areas) from regions where areas in (@areas)
The @areas parameter in the function are going to be used in a "in" statement as well. I tried to receive it with a varchar parameter but this causes an error. When I use the SQL Profiler, I see that the parameter is passed in this format:
N''1'',N''2'',N''3''
The specific questions here are, what data type the function parameter @areas must be? And how can I use that parameter into a "in" statement in the function?
Thanks