--方法二:适用于任何版本

SELECT  salesID [业务编号] ,
        c1 - LEN(REPLACE(LEFT(salesOrd, c1), ', ', '')) + 1 [序号] ,
        SUBSTRING(salesOrd, c1, CHARINDEX(', ', salesOrd + ', ', c1) - c1) AS [值]
FROM    arrays
        JOIN Nums ON c1 <= LEN(salesOrd)
                     ANDSUBSTRING(', ' + salesOrd, c1, 1) = ', '
ORDER BY salesID ,
        [序号]

  --方式三:适用于2005以上版本,使用CTE实现:

WITH    SplitCTE
          AS ( SELECT   salesID ,
                        1 AS pos ,
                        1 AS startpos ,
                        CHARINDEX(', ', salesOrd + ', ') - 1 AS endpos
              FROM    dbo.Arrays
              WHERE   LEN(salesOrd) > 0
              UNION ALL
              SELECT  Prv.salesID ,
                        Prv.pos+ 1 ,
                        Prv.endpos+ 2 ,
                        CHARINDEX(', ', CUR.salesOrd + ', ', Prv.endpos + 2)
                        - 1
              FROM    SplitCTE ASPrv
                        JOIN dbo.Arrays AS Cur ON CUR.salesID = Prv.salesID
                                                 AND CHARINDEX(', ',
                                                             cur.salesOrd
                                                             + ', ',
                                                             Prv.endpos + 2) > 0
            )
    SELECT  A.salesID AS [业务编号] ,
           pos [序号] ,
           CAST(SUBSTRING(salesOrd, startpos, endpos - startpos + 1) AS INT) AS [值]
    FROM    dbo.Arrays AS a
           JOIN SplitCTEAS S ON S.salesID = A.salesID
    ORDER BY A.salesID ,
           pos
 GO

  --方法4:使用自定义函数

CREATE FUNCTION dbo.fn_split( @orders AS VARCHAR(MAX) )
RETURNS TABLE
AS
    RETURN
    SELECT  c1 - LEN(REPLACE(LEFT(@orders, c1), ', ', '')) + 1 AS [序号] ,
           SUBSTRING(@orders, c1, CHARINDEX(', ', @orders + ', ', c1) - c1) AS [值]
    FROM    dbo.Nums
    WHERE   c1 <= LEN(@orders)
           AND SUBSTRING(', ' + @orders, c1, 1) = ', ' ;
    GO
  
    --然后使用cross apply技巧,合并分解字符串
SELECT  salesID ,
        B.*
FROM    Arrays a
        CROSS APPLY dbo.fn_split(a.salesOrd) b
    GO

  通过一下执行计划的开销可以看到CTE方法的实现开销小,所以建议使用这种方式处理: