당신은 다음과 같은 기능을 사용하여 문자를 구분하는 문자열을 분할 할 수 있습니다 :
create function ftStringCharacters
(
@str varchar(100)
)
returns table as
return
with v1(N) as (
select 1 union all select 1 union all select 1 union all select 1 union all select 1
union all
select 1 union all select 1 union all select 1 union all select 1 union all select 1
),
v2(N) as (select 1 from v1 a, v1 b),
v3(N) as (select top (isnull(datalength(@str), 0)) row_number() over (order by @@spid) from v2)
select N, substring(@str, N, 1) as C
from v3
GO
그리고로 적용하는 기능을 사용하지 않고
update t
set t.FieldName = p.FieldModified
from TableName t
cross apply (
select (select quotename(s.C)
from ftStringCharacters(t.FieldName) s
order by s.N
for xml path(''), type).value('text()[1]', 'varchar(20)')
) p(FieldModified)
SQLFiddle sample
완벽하게 작동했습니다! 고맙습니다!! – Eric