• Must agree with Sean and Dwain.

    Either pass in separated values and split the strings to a temporary table/table variable and join to that, or if you feel comfortable pass in a tvp and use it directly in the join.

    IN righfully sucks with parameters.... IN also with large quantities of values tends to suck on performance.

    IN is nothing more than shorthand for multiple OR = 's tests.... enough of those will choke a query.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]