最简单的如下:
select top 1000 identity(int,1,1) as id into #tmp from sysobjects a,sysobjects bselect right('0000'+cast(id+2 as varchar),4) from #tmp
select top 1000 identity(int,1,1) as id into #tmp from sysobjects a,sysobjects bselect right('0000'+cast(id+2 as varchar),4) from #tmp
解决方案 »
- 列名 'dayclicktime' 无效。 帮忙看看是什么原因。
- insert语句的一个问题。。。
- 同时返回几个表的记录个数
- 能不能向sysobjects系统表中插入数据?
- 急!~~~~~~~~`求救:把这两句合并成一句,并求出 jksl-cksl
- 如何确认分发时的重复记录???
- 这句话正确吗?sql="select * from user where dateandtime="#date#"
- 关于一个锁的问题
- windows 2000 server 能够安装MSDE吗?为什么我的不行
- sql server如何做到只取一页记录
- 存储过程中,怎么使用多个游标
- 关于导出数据库中表的结构!着急!!急急急!
select id=right(10001+a.id+b.id*10+c.id*100,4)
from(
select id=0 union all select 1
union all select id=2 union all select 3
union all select id=4 union all select 4
union all select id=6 union all select 7
union all select id=8 union all select 9
) a,(
select id=0 union all select 1
union all select id=2 union all select 3
union all select id=4 union all select 4
union all select id=6 union all select 7
union all select id=8 union all select 9
) b,(
select id=0 union all select 1
union all select id=2 union all select 3
union all select id=4 union all select 4
union all select id=6 union all select 7
union all select id=8 union all select 9
) c
order by id