IF OBJECT_ID('tb') IS NOT NULL

   DROP TABLE tb

GO

CREATE TABLE tb (id INT,col VARCHAR(30))

INSERT  INTO tb VALUES  (1,'aa,bb')

INSERT  INTO tb VALUES  (2,'aaa,bbb,ccc')

go



SELECT T1.ID

,SUBSTRING(T1.COL,T2.NUMBER,CHARINDEX(',',T1.COL+',',NUMBER)-T2.NUMBER)

FROM TB T1

INNER JOIN MASTER..SPT_VALUES T2

ON T2.TYPE='P' AND CHARINDEX(',',','+T1.COL,T2.NUMBER)=T2.NUMBER


--结果:

/*

1aa

1bb

2aaa

2bbb

2ccc


*/