在sqlserver2008中“新建查询”,执行批量添加语句的执行时间:
declare @i int
set @i=1
while(@i<=200000)
begin INSERT INTO [xxx].[dbo].[北京万奇亚讯科技_QueryLog]
([ID]
,[IID]
,[IName]
,[QueryTime]
,[IsH]
,[IsC]
,[IsS]
,[ext1]
,[ext2]
,[CreateUser]
,[CreateTime]
,[UpdateUser]
,[UpdateTime])
VALUES
('0ea1d805-8169-41eb-9822-6f40d50f1675'
,'a5f9b7ab84d55ff589745755b95cd97f4ca8cf75'
,'a5f9b7ab84d55ff589745755b95cd97f4ca8cf75'
,GETDATE()
,0
,1
,1
,''
,''
,'admin'
,GETDATE()
,'admin'
,GETDATE()) set @i=@i+1
end
10000 条数据 用了3秒
50000 条数据 21秒
100000 条数据 42秒
40000 条数据 16秒
200000 条数据 1:37秒