SELECT TOP 1000000 IDENTITY(INT,0,1) AS idx INTO dbo.t_Numbers FROM master.sys.all_columns c1 CROSS JOIN master.sys.all_columns c2 -- 利用row_number更加快速地创建和填充数字表;100万数字表1s内就生成好了 drop table t_Numbers SELECT TOP 1000000 ROW_NUMBER() over (order by c1.object_id) AS N INTO dbo.t_Numbers FROM master.sys.all_columns c1 CROSS JOIN master.sys.all_columns c2 drop table t_Numbers