本文介绍了将数据从一个数据库传输到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 海...我有三个表与不同的数据库我需要移动数据TableName2基于分支到tablename3,每个ItmsGrpCod(TableName3)转移(FrmDate ToDate百分比)请任何人给我的想法... TableName1(parenttable)Databasename1 DocEntry Branch FrmDate ToDate 1 01 2013-04-12 2013-04-16 2 01 2013-04-12 2013-04-16 3 01 2013-04-12 2013-04-16 4 01 2013-04-12 2013-04-16 5 03 2013 -04-12 2013-04-16 6 02 2013-04-12 2013-04-16 TableName2 Databasename1 DocEntry FrmDate ToDate百分比 1 12/04/2013 16/04/2013 10 2 12/04/2013 16/04/2013 9 3 12 / 04/2013 16/04/2013 10 4 12/04/2013 16/04/2013 12 5 12/04/2013 16/04/2013 10 TableName3 Databasename3 ItmsGrpCod,ItmsGrpNam 100 项目 101 附件 102 HP打印机 103 IBM打印机 104 个电脑 105 服务器 i基于分支ID需要输出这样的(TableName1 Databasename1) DocEntry GrpCode FrmSlab ToSlab百分比 1 100 12/04/2013 12/04/2013 10 2 101 12/04/2013 12/04/2013 9 3 102 12/04/2013 12/04/2013 10 4 103 12/04/2013 12/04 / 2013 12 5 104 12/04/2013 12/04/2013 10 105 12/04/2013 12/04/2013 12 解决方案 您可以使用SP_AddLinkedServer互相连接服务器,然后您可以编写简单查询,将数据从一个表插入另一个表。 请参考以下链接 http://msdn.microsoft.com/en- in / library / ms190479.aspx [ ^ ] http://www.sql-server-performance.com/forum/threads/how-to-use -sp_addlinkedserver.17119 / [ ^ ] http://www.sqlservercentral.com/Forums/Topic98741-9-1.aspx [ ^ ] Hai.. i have three table with different database i need move data TableName2 based on Branch to tablename3 , each ItmsGrpCod(TableName3 )to transfer the(FrmDate ToDate Percent)Please any one give me idea...TableName1(parenttable )Databasename1DocEntryBranchFrmDateToDate1012013-04-122013-04-162012013-04-122013-04-163012013-04-122013-04-164012013-04-122013-04-165032013-04-122013-04-166022013-04-122013-04-16TableName2 Databasename1DocEntry FrmDate ToDate Percent112/04/201316/04/201310212/04/201316/04/20139312/04/201316/04/201310412/04/201316/04/201312512/04/201316/04/201310TableName3 Databasename3ItmsGrpCod,ItmsGrpNam100Items101Accessories102HP Printers103IBM Printers104PCs105Serversi need out put like this based on Branch id(TableName1 Databasename1)DocEntry GrpCode FrmSlabToSlabPercent110012/04/201312/04/201310210112/04/201312/04/20139310212/04/201312/04/201310410312/04/201312/04/201312510412/04/201312/04/20131010512/04/201312/04/201312 解决方案 You can Use SP_AddLinkedServer for connecting server each other and then you can write simple query for inserting data from one table to another.Please refer below linkhttp://msdn.microsoft.com/en-in/library/ms190479.aspx[^]http://www.sql-server-performance.com/forum/threads/how-to-use-sp_addlinkedserver.17119/[^]http://www.sqlservercentral.com/Forums/Topic98741-9-1.aspx[^] 这篇关于将数据从一个数据库传输到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-13 16:41