日期:2014-05-18 浏览次数:20426 次
select top 8000 id = identity(int,1,1) into temp from syscolumns go select * from temp
declare @n int select @n=16 select number id into #t from master.dbo.spt_values where [type]='P' and number between 1 and @n select * from #t id ----------- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
------解决方案--------------------
可以利用笛卡尔积的形式去生成,05或其以上版本试试with cte和row_number排序函数。