Morning All,
I am currently attempting to implement multi valued parameters in SQL2005 / SSRS2005
I have went about this in the way suggested in many blogs / walk throughs, using an expression to comma seperate the parameters like so:
=Join(Parameters! <ParameterName> .Value,", ")
I then use a function to split out the parameters.
WHERE
close_date BETWEEN @FROMCLOSEDATE AND @TOCLOSEDATE
AND (Group_ID IN (SELECT Val from dbo.fn_String_To_Table(@RESGROUP,',',1)))
This now works as expected. The Stored Procedure is searching 1.4 million rows to find dates between the parameters and IN RESGROUP
, this takes a very long time, so it would be best if an index was used. From what I gather the index isn't used because of the Table Valued Functions.
Is there anything else I can do to improve performance in this scenario?
Try to insert the return values from the function into a temp table and use that in the query and see the performace.
Other wise you can try dynamic query.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.