EntityID, AttributeID
のペアごとに XMLパストリックを使用してCSVを生成します
SELECT
M.EntityID, M.AttributeID,
SUBSTRING(CAST(foo.bar AS varchar(8000)), 2, 7999) AS Options
FROM
(
SELECT DISTINCT EntityID, AttributeID
FROM MyTable
) M
CROSS APPLY
(
SELECT
',' + OptionText
FROM
MyTable M2
WHERE
M.EntityID = M2.EntityID AND M.AttributeID= M2.AttributeID
FOR XML PATH ('')
) foo(bar)