if object_id('MyDB.dbo.Numbers') is not null
    drop table MyDB.dbo.Numbers
go

use [MyDB]
go

create table dbo.Numbers(ID INT NOT NULL)
go

create unique clustered index ix_uniq_clst_numbers_id on dbo.Numbers(id)
go

with t as (
select row_number() over (order by col1) as rowno from (
select top 1000000 1 as col1
from sys.syscolumns a, sys.syscolumns b, sys.syscolumns c) t
)

insert into dbo.Numbers select rowno from t order by rowno

 

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2021-09-18
  • 2022-01-19
  • 2021-11-30
  • 2021-11-27
  • 2021-07-03
  • 2022-02-02
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-04-19
  • 2021-10-08
  • 2023-02-21
  • 2021-09-02
  • 2021-05-27
相关资源
相似解决方案