你准备要生成什么样的数据呀
批量插入
无非就用
select * into 新表 from 旧表
insert into 新表 select * from 旧表

解决方案 »

  1.   

    你要插入什么数据呀
    批量插入嘛
    无非用select * into newtable from oldtable
    insert into newtable select * from oldtable
      

  2.   

    eg:
    declare @i int
    set @i = 1
    while @i <= 10
    begin
    insert into 新表 select 数量字段*@i,其它字段 from 旧表
    set @i = @i + 1
    end
      

  3.   

    其实我的意思是通过循环语句或其他语句在oldtable的基础上生成新的数据,再把生成的数据插入到oldtable中,生成新的newtable,这样新的数据表的数据就会多很多啊,就不需要人为一个一个插入新的数据的操作,减少很多的手工的不必要的劳动啊!!!
      

  4.   

    关键是你从oldtable生成新数据是否做过修改
      

  5.   

    我大概猜出你的意思了declare @i int
    set @i=1while @i<1000
    begin
    insert into tablename select * from tablename
    set @i=@i+1
    end
      

  6.   

    select co1,col2,col3,.. into newtale from oldtable
      

  7.   

    我大概猜出你的意思了declare @i int
    set @i=1while @i<1000
    begin
    insert into tablename select * from tablename
    set @i=@i+1
    end
      

  8.   

    我是要把oldtable里的数据修改以后,生成大量的所谓新的数据,再把新的数据插入到oldtable里,这样就生成了newtable了,呵呵!!!
      

  9.   

    SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GOCREATE  Proc sp_person_isp as
    declare  @i int
    set @i = 1
    while @i <= 100
    begin
    insert into aaaa select cG_BarCode+@i,cG_Name,cG_Code,cClassCode,cG_Spec, cG_Area ,cG_Unit, cG_Box, fG_BCount, cShelfCode, cWareCode, dG_Date, 
    dG_Tag ,dG_Time ,mG_Uprice ,mG_Ucost, fG_Rate,cG_CounterCode ,cG_DeptCode, cG_Type ,cSp_Code, bAutoMove ,bAutoStock,
    iW_Max ,iW_Min,fSaleCount, iW_DayCount mG_Mppicea , cG_Style ,iG_Day,fG_CostRate, cG_Brand ,iG_DateNum , cG_Package ,
    cG_Ratify ,cG_Lable,mP_Uprice1,mP_Uprice2,mP_Uprice3,fG_Count2,fP_Count3,iG_DayNum,dP_BegDate,dP_EndDate,dP_BegTime,dP_EndTIme,                                            
    bSendAcc, dg_time2 , mg_newcost,mg_oldcost, dp_sl1,dp_sl2, dp_sl3 , dp_sl4,mp_sluprice1,mp_sluprice2,mp_sluprice3  from gpinfo
    set @i = @i + 1
    end
    GO
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO--为什么我在运行的时候出现以下的提示
    服务器: 消息 213,级别 16,状态 4,过程 sp_person_isp,行 7
    插入错误: 列名或所提供值的数目与表定义不匹配。
    请前辈赐教!!!!
      

  10.   

    你检查一下aaaa表的字段个数与你的SQL中的字段个数是否一样。
    declare @i int
    set @i=0
    while @i<1000
    begin
      insert into aaaa select cG_BarCode+@i,cG_Name,...from gpinfo
      where cG_BarCode>0 and  cG_BarCode<=100 
      set @i = @i + 100
    end
    这样便会产生100000条数据了