Если у вас есть известное или максимальное количество столбцов И открытых для функции HELPER.
Пример
Select A.ID
,t1 = B.Pos1
,t2 = B.Pos2
,t3 = B.Pos3
,pval1 = C.Pos1
,pval2 = C.Pos2
,pval3 = C.Pos3
,spval1 = D.Pos1
,spval2 = D.Pos2
,spval3 = D.Pos3
,amt_1 = E.Pos1
,amt_2 = E.Pos2
,amt_3 = E.Pos3
From YourTable A
Cross Apply [dbo].[tvf-Str-Parse-Col]([TYPE],',') B
Cross Apply [dbo].[tvf-Str-Parse-Col]([prouctValues],',') C
Cross Apply [dbo].[tvf-Str-Parse-Col]([subproValues],',') D
Cross Apply [dbo].[tvf-Str-Parse-Col]([Amount],',') E
Возвращает
TVF, если интересно
CREATE FUNCTION [dbo].[tvf-Str-Parse-Col] (@String varchar(max),@Delimiter varchar(10))
Returns Table
As
Return (
Select Pos1 = ltrim(rtrim(xDim.value('/x[1]','varchar(max)')))
,Pos2 = ltrim(rtrim(xDim.value('/x[2]','varchar(max)')))
,Pos3 = ltrim(rtrim(xDim.value('/x[3]','varchar(max)')))
,Pos4 = ltrim(rtrim(xDim.value('/x[4]','varchar(max)')))
,Pos5 = ltrim(rtrim(xDim.value('/x[5]','varchar(max)')))
,Pos6 = ltrim(rtrim(xDim.value('/x[6]','varchar(max)')))
,Pos7 = ltrim(rtrim(xDim.value('/x[7]','varchar(max)')))
,Pos8 = ltrim(rtrim(xDim.value('/x[8]','varchar(max)')))
,Pos9 = ltrim(rtrim(xDim.value('/x[9]','varchar(max)')))
From ( values (cast('<x>' + replace((Select replace(@String,@Delimiter,'§§Split§§') as [*] For XML Path('')),'§§Split§§','</x><x>')+'</x>' as xml))) A(xDim)
)