SQL Server循环插入100000条数据

create table Book
(
id int primary key identity,
name varchar(20),
date datetime,
remark varchar(50)
)

    --循环执行插入10000条数据
    declare @id int
    declare @name nvarchar(20)
    declare @date datetime
    declare @remark nvarchar(50)
    begin
    set @id=1
    set @name='张三'
    set @date='2010-01-01 08:22:24.990'
    set @remark='吃饭,睡觉,打豆豆'
    while @ID<=100000
    begin
    insert into Book(name,date,remark)
    values(@name,@date,@remark)
    set @id=@id+1 
    set @date=@date+1
    end
    end

 

posted @ 2020-07-10 11:13  Hero-韦先生  阅读(384)  评论(0编辑  收藏  举报