create table T(A varchar(10), B int, C int) insert T select 'a' , 1, 2 union all select 'b' , 2, 3 union all select 'c' , 3, 4 union all select '1d', 5, 6 union all select '1e', 6, 7 union all select '1f', 8, 9update T set A='1'+A where charindex('1', A)<>1select * from T--result A B C ---------- ----------- ----------- 1a 1 2 1b 2 3 1c 3 4 1d 5 6 1e 6 7 1f 8 9(6 row(s) affected)
update 上表 set 上表.A='1'+ A where substring(A,1,1)<>'1'
insert T select 'a' , 1, 2
union all select 'b' , 2, 3
union all select 'c' , 3, 4
union all select '1d', 5, 6
union all select '1e', 6, 7
union all select '1f', 8, 9update T set A='1'+A
where charindex('1', A)<>1select * from T--result
A B C
---------- ----------- -----------
1a 1 2
1b 2 3
1c 3 4
1d 5 6
1e 6 7
1f 8 9(6 row(s) affected)
set 上表.A='1'+ A
where substring(A,1,1)<>'1'