CREATE TABLE [traitStressArc3] (
[RecID] [int] IDENTITY (1, 1) NOT NULL ,
[TraitID] [int] NOT NULL
) ON [PRIMARY]
GO
declare @i int
set @i = 1
while @i < 10000
begin
insert traitStressArc3 (TraitID) values (@i)
set @i = @i + 1
end我插入10000条数据在台式机上只用了2秒,而在一台服务器上用时100秒,是什么原因啊,有人碰到过吗?
[RecID] [int] IDENTITY (1, 1) NOT NULL ,
[TraitID] [int] NOT NULL
) ON [PRIMARY]
GO
declare @i int
set @i = 1
while @i < 10000
begin
insert traitStressArc3 (TraitID) values (@i)
set @i = @i + 1
end我插入10000条数据在台式机上只用了2秒,而在一台服务器上用时100秒,是什么原因啊,有人碰到过吗?
CREATE TABLE [traitStressArc3] (
[RecID] [int] IDENTITY (1, 1) NOT NULL ,
[TraitID] [int] NOT NULL
) ON [PRIMARY]
GO
insert into [traitStressArc3]
select a.number+(2048*b.number)+1
from master..spt_values a,master..spt_values b
where a.type='p' and b.type='p' and a.number+(2048*b.number)+1<=10000
select * from [traitStressArc3]
go
drop table [traitStressArc3]