查询的时候 select right(10000+id,4) as id from tablename
发表于:2007-03-16 14:21:202楼 得分:0
create table test(id varchar(10)) insert test select 1 union all select 2 union all select 3 union all select 4 go update test set id = right(10000 + id, 4)
select * from test go drop table test --result /* id 0001 0002 0003 0004 */