• It's work noting that wolfkill and I are using the same splitter[/url] (I mine just has a different name).

    -- sample data

    IF OBJECT_ID('tempdb..#x') IS NOT NULL

    DROP TABLE #x;

    CREATE TABLE #x (id int identity primary key, val nvarchar(100) NOT NULL);

    INSERT INTO #x

    SELECT '55,85,1,4,9888,6587' UNION ALL --we want this one

    SELECT '55,85,1,4,98,65' UNION ALL --we don't want this

    SELECT '1122,33333,22,11,40' UNION ALL --we want this one

    SELECT '312,9,8,7' --we don't want this

    GO

    -- code to get what you need

    WITH legitIDs AS

    (SELECT id

    FROM #x x

    CROSS APPLY dbo.splitString(x.val,',')

    WHERE LEN(item)>=4

    GROUP BY id)

    SELECT val

    FROM #x x

    JOIN legitIDs l ON x.id=l.id;

    --cleanup

    DROP TABLE #x;

    GO

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001