日期:2014-05-18 浏览次数:20729 次
select right('0000000' + rtrim(cast('0931105' as int)+1), 7);
select right('0000000' + rtrim(cast(dh as int)+1), 7);
------解决方案--------------------
--> 测试数据:[test]
if object_id('[test]') is not null drop table [test]
create table [test]([dh] varchar(7))
insert [test]
select '0931105' union all
select '0931106' union all
select '0931107'
update test
set [dh]='0'+ltrim(CAST([dh] as int)+1)
select * from test
/*
dh
0931106
0931107
0931108
*/