• -- NOTE: Be sure to remove the lowercase letter 'x' from the CREATE and DROP T-SQL keywords in this code - my company blocks internet traffic that includes certain T-SQL keywords.

    CxREATE TABLE #TEMP (rowID int identity(1,1), delimitedString varchar(60))

    GO

    INSERT INTO #TEMP

    VALUES (', 55,85,1,4,9888,6587,'), (', 55,85,1,4,98,65,' )

    GO

    WITH cte1 AS (

    SELECT c.rowID, s.Item, LEN(s.Item) as valueLen

    FROM #TEMP c

    OUTER APPLY dbo.DelimitedSplit8K(c.delimitedString,',') s

    WHERE LEN(s.Item) > 3

    )

    SELECT t.rowID, t.delimitedString

    FROM #TEMP t

    WHERE EXISTS (SELECT 1 FROM cte1 c WHERE t.rowID = c.rowID)

    GO

    DxROP TABLE #TEMP[/code]

    OP, you'll need to have some column to uniquely identify each row of your input - if the table has a primary key, you can use that in place of the rowID column I created in my #TEMP table. In cte1, I parsed each string into its values using my version of Jeff Moden's string splitter function and included the rowID where LEN(<parsed value>) > 3. Then I selected rows from #TEMP where the rowID exists in cte1, which gives me only the rows where the LEN() > 3 for any parsed value in the comma-delimited string.

    If the CTE in my code causes performance issues with your data, you could convert it to a temp table with an appropriate index to speed things up. No matter what you do, though, parsing delimited strings for any number of rows will be pretty slow.

    Hope that helps!

    Jason Wolfkill