用  while 变量<1300
begin
insert into ....
end

解决方案 »

  1.   

    select top 1300 identity(int,1,1) as id into #t from sysobjects A,sysobjects B
    insert tab(intfield) select id from #t order by id
    drop table #t
      

  2.   

    我运行了,可是这1300条记录存到哪里了呢?这些SQL语句代表什么?对不起,小弟才疏学浅,愿各位高手赐教
      

  3.   

    我来解释一下:--这句照原样:
    select top 1300 identity(int,1,1) as id into #t from sysobjects A,sysobjects B--这句中的tab改成你的表的名字,intfield改成你要添加1-1300的数字的字段。
    insert tab (intfield) select id from #t order by id--这句照原样:
    drop table #t执行后,打开你的表看看。
      

  4.   

    可以直接把如下语句在查询分析器执行看看:create table test(ord int,name nvarchar(8))
    select top 1300 identity(int,1,1) as id into #t from sysobjects A,sysobjects B
    insert test(ord) select id from #t order by id
    drop table #t
    select * from test
    另请教J老师,若楼主的意思是:
    原表中已有N条记录,然后需从头开始将某字段的值改为1-1300呢