如何瞬间在数据库插入一百万条记录

这两天发现了一个东西很好玩:
如何在你的数据库中插入一百万条记录(要求三分钟之内)hoo~~hoo~~~
1 首先
create table news
    (
          newsid int primary key auto_increment,
        newstitle varchar(100),
        newscontent varchar(200),
        newsdate date default now(),
        newscount int
    )
2 随便插入一些数据:
insert into(newstitle,newscontent,newscount)values('aa','bb',100)
3 然后执行下面语句★★★★★:
insert into news(newstitle,newscontent,newscount)
            select newstitle,newscontent,newscount from news
以上是mysql版  如果用在mssql版本也一样的 就此打住 。。。。读书咯。。。。
千万不要贪心啊。。。插入太多卡死机子了。。。。明天还要数模。。。。郁闷中。。。。。

 

你可能感兴趣的:(数据库)