取某一字段的后几位和将某一字段填充为指定长定
insert into #aa(code,[name])
select '1','sssssssssssss'
insert into #aa(code,[name])
select '2','sssssssssssss'
union all
select '3','gsssss'
insert into #aa(code,[name])
select '14','as'
update #aa
set [name] = right([name],3),
code = right( '000' + isnull(code,''),3)
select * from #aa
drop table #aa