日期:2014-05-17 浏览次数:20603 次
create table t
(
id int identity(1,1) primary key,
OrderId as replace(convert(varchar(10),getdate(),120),'-','')+right('00000000'+ltrim(id),8),
Others varchar(20)
)
go
insert t(Others)
select 'a' union all
select 'b' union all
select 'c'
go
select * from t
drop table t
/*
id OrderId Others
--------------------------------
1 2013070800000001 a
2 2013070800000002 b
3 2013070800000003 c
*/