用一条语句实现在表中插入n条相同记录,即现在想把一条记录复制n条 
如 :insert   into   table1   select   *   from   table1   where  ?

解决方案 »

  1.   

    例如复制tabel1中1点的记录,使 2点 ,3点 的内容和1点的内容相同 
      

  2.   

    declare @i int 
    set @i = 1
    while @i <= 10 
    begin
     insert  into  table1  select  top 1  *  from  table1  
     set @i= @i+1
    end 
      

  3.   

    insert into 表名(字段) select 字段 from 表名 where 条件
    例如:
    insert into YIEN_TempletePreconfig(YIPCID,YITSerialNum,YITCProjectName) select 2,YITSerialNum,YITCProjectName from YIEN_TempletePreconfig where YITSerialNum='Com_001' 
    OSQL:
    insert   into   table()   values()   
      select   ...  go   10000
      

  4.   


    这样就行!用while循环插入!
      

  5.   

    select * into table2 from table1 where time=1点