SQL在1秒内插入100万行数字列

DBCC DROPCLEANBUFFERS

DBCC FREEPROCCACHE

declare @beginTime datetime

set @beginTime=getdate()

SELECT TOP 1000000 ROW_NUMBER() over (order by c1.object_id) as RowNumber

INTO dbo.t_Numbers

FROM master.sys.all_columns c1

CROSS JOIN master.sys.all_columns c2

select datediff(ms,@beginTime,getdate()) as[Time(ms)]

你可能感兴趣的:(sql)