请问怎样用delphi 实现把数据库a 中表1的数据复制到数据库b 的表2中?谢谢!

解决方案 »

  1.   

    在Query组件中嵌入SQL语句select * into t from tb 或者用TBatchMove组件,怎么用看帮助文档
      

  2.   

    1楼是错的
    use b
    select * into  表2 from a..表1
      

  3.   

    忘记说了数据库sql2000或SQL2005
      

  4.   

    樓上各位,所說的衹適用於表結構完全一樣的兩個表,如果字段數不同,或者要插入的表中有自增列的話,必須採用如下方式:insert into table1(col1,col2,col3) select col1,col2,col3 from table2
      

  5.   

    招聘 delphi 程序员(人数:2)
     毕业两年以上
     两年以上 delphi 工作经验
     熟悉 sql server 
     sql 编写能力突出者优先联系方式:
     深圳中普达科技有限公司
     0755 86170837
     请将简历发至 [email protected]
      

  6.   

    沒注意看,原來是兩個數據庫,下面的做法是沒錯的EXEC    sp_addlinkedserver    @server='RemoteSvr', @srvproduct='',@provider='SQLOLEDB', @datasrc='遠程SQL服務器'
    insert into table1(col1,col2,col3) select col1,col2,col3 from RemoteSvr.[數據庫名].dbo.table2
    exec sp_dropserver 'RemoteSvr'