在一点帮助下数字表 https://stackoverflow.com/questions/10819/sql-auxiliary-table-of-numbers and for xml path.
-- Sample table
declare @T table
(
Value nvarchar(100)
)
-- Sample data
insert into @T values
('ARAMAU'),
('ARAMAUBEBABRBGCNDKDEEEFOFIFRGEGRIEISITJPYUCAKZKG')
declare @Len int
set @Len = 2;
select stuff(T2.X.value('.', 'nvarchar(max)'), 1, 1, '')
from @T as T1
cross apply (select ','+substring(T1.Value, 1+Number*@Len, @Len)
from Numbers
where Number >= 0 and
Number < len(T1.Value) / @Len
order by Number
for xml path(''), type) as T2(X)
Try on SE-Data https://data.stackexchange.com/stackoverflow/query/70235