当前位置: 代码迷 >> SQL >> Sql Server 循环语句安插
  详细解决方案

Sql Server 循环语句安插

热度:41   发布时间:2016-05-05 10:56:23.0
Sql Server 循环语句插入

有个表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 intset @a=1while @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 @[email protected]+1    end

MSSQLServer上测试通过~

  相关解决方案