insert into tb select * from ta

解决方案 »

  1.   

    insert into tb select * from ta
      

  2.   


    if object_id('tb') is not null
    drop table tb
    select * into tb from ta
      

  3.   

    insert tb select * from tainsert tb (列..) select 列.. from ta
      

  4.   

    IF EXISTS(SELECT name FROM sysobjects 
    WHERE  name = tb AND type = 'U')
    DROP TABLE tb
    GO
    select * into tb from ta--或insert into tb 
    select * From ta
      

  5.   

    假设你的表里有一个主键 pkey
    insert into tb (select * from ta where pkey not in (select pkey from tb))
    就可以把ta中的记录不重复地添加到tb了
      

  6.   

    insert into tb select * from ta老兄!我试了一下!你也可以直接用DTS!(一劳永逸呵!)因为DTS也是执行INSERT操作!
    下面是DTS系统执行时的脚本:
    insert bulk [aspnet].[dbo].[TABLE1]("id" char(10) COLLATE Chinese_PRC_CI_AS,"name" char(10) COLLATE Chinese_PRC_CI_AS,"age" char(10) COLLATE Chinese_PRC_CI_AS)with(check_constraints)
      

  7.   

    insert tb (列..) select 列.. from ta
    即使有自动增长列也不怕!