• wolfkillj (1/24/2012)


    Your splitter function returns the expected results, but the code in the stored proc should select the column Item from the function in the subselect in the WHERE clause, not State. Does that help?

    The function does not return the required results and there is a SELECT in the WHERE Clause.

    WHERE Comp.Status = 'A'

    AND State IN (SELECT State FROM dbo.Split(@State, ','))

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/