>Hi
>I have a SP which accept parameter of "EmployeeNoList". The value of the parameter could be '00001, 00002, 00100, 00120'. The # of employeeNo in the list could be few to hundred/thousand.
>
>Currently, I use a function that will split the list into table and INNER JOIN with "actual" complex SQL statement in order to speed up the performance / prevent use of dynamic SQL. I was told that is some way to have better performance. Anyone shall share how to optimize it?
>
>Thank you
I think your solution is fine - first split the list into a temp table (you can define a PK on this table if your list contains only unique entries) and then join with that table.
If it's not broken, fix it until it is.
My Blog