SQL2000vsSQL2005
同一台电脑测试 SQL2000Sp4 企业版 vs SQL2005 企业版
--CREATE TABLE [TestTable] (
-- [ID] [int] IDENTITY (1, 1) NOT NULL ,
-- [FirstName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
-- [LastName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
-- [Country] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
-- [Note] [nvarchar] (2000) COLLATE Chinese_PRC_CI_AS NULL
--) ON [PRIMARY]
--GO
[ID] 主键
[FirstName] 非聚集索引
[LastName] 非聚集索引
插入1000000条
SET IDENTITY_INSERT TestTable ON
declare @i int
set @i=1
while @i<=1000000
begin
insert into TestTable([id], FirstName, LastName, Country,Note) values(@i, 'FirstName_XXX','LastName_XXX','Country_XXX','Note_XXX')
set @i=@i+1
end
SET IDENTITY_INSERT TestTable OFF
2005用时: 00:07:28
2000用时: 00:05:27