• http://www.sqlservercentral.com/articles/Tally+Table/72993/

    Pass the values in as a comma separated string, and join to or use where exists to the above referenced function.

    FROM Table X

    INNER JOIN DelimitedSplit8k('parameter values', ',') S ON X.field = S.Item

    OR

    FROM Table X

    WHERE EXISTS (SELECT S.Item FROM DelimitedSplit8k('parameter values', ',') S WHERE S.Item = X.field

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/