日期:2014-05-17 浏览次数:20507 次
if object_id('dbo.t') is not null
drop table dbo.t
go
--只包含a一个字段
create table t(a varchar(100));
insert into t values('ttt')
insert into t values('txt')
insert into t values('exe')
go
declare @i int;
set @i = 0;
update t
set @i= @i + 1,
a = RIGHT('000' + cast(@i as varchar),3)
select * from t