首页 > 数据库技术 > 详细

Sql Server 循环语句插入

时间:2015-01-05 00:34:43      阅读:276      评论:0      收藏:0      [点我收藏+]

有个表tt

描述为:

q (PK,int,not null)
w (nchar(10),not null)
e (int,not null)
r (int,not null)
t (int,not null)
y (int,not null)
u (int,not null)
i (int,not null)
o (int,not null)
p (int,not null)

循环插入语句为:

declare @a int
set @a=1
while @a<10001
    begin
    insert into tt (q,w,e,r,t,y,u,i,o,p) values (@a,'a',1,1,1,1,1,1,1,1)
    set @a=@a+1
    end

MSSQLServer上测试通过~

Sql Server 循环语句插入

原文:http://blog.csdn.net/wdkirchhoff/article/details/42388103

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!