通过SQL把n条记录插入表中

这里插入20000条

--插入数据 
 通过SQL把n条记录插入表中set identity_insert TestTable on 
 通过SQL把n条记录插入表中declare @count int 
 通过SQL把n条记录插入表中set @count=1 
 通过SQL把n条记录插入表中while @count<=20000
 通过SQL把n条记录插入表中begin  
 通过SQL把n条记录插入表中    insert into tb_TestTable(id,Name) values(@count,'admin'
 通过SQL把n条记录插入表中    set @count=@count+1 
 通过SQL把n条记录插入表中end 
通过SQL把n条记录插入表中set identity_insert tb_TestTable off

相关文章: