insert into d_table select * from s_table

解决方案 »

  1.   

    insert into tablename select ....
      

  2.   

    insert into 目的表 select * from 源表
      

  3.   

    insert table2
    select col1, col2 ... from table1
      

  4.   

    insert into table(field1,field2) select field1,field2 from table2
      

  5.   

    insert 新表 select * from 旧表
      

  6.   

    问题来了:
    这样一来,我导入数据的目的表中的记录无法删除了,报错:“键列的信息不足或出错,更新影响到过多的表”是否可以建立一个临时表?
    ——之中的数据从select选择的数据集中导入,用完就删除。谢谢诸位!
      

  7.   

    if object_Id(#temp) is not null
        drop table #temp
     
    GO
    select * into #temp from 旧表.insert 新表 select * from #tempdrop #temp
    感觉一样。呵呵