简体   繁体   English

如何从一个数据库到另一个数据库获取数据?

[英]How to get a data's from one database to other database?

Using SQL 2000, SQL 2005 使用SQL 2000,SQL 2005

Old Database Name is – Sysdatabase
New Database Name is - Dual_Proone, Dual_Protwo

In the above two database table name and column name are different, but values are same. 在上面的两个数据库中,表名和列名是不同的,但是值是相同的。

For Example 例如

Sysdatabase (Database Name)

Person (Table Name)

Column Names and values are

ID Date 

001 23-02-2009
002 24-02-2009

So on…, 等等...,

Company (Table Name)

Column Names and Values are

Code Name

1001 Micorsoft
1002 Dell

So on.., 等等..,

Dual_Proone (Database Name)

T_person (Table Name)

Column Names and values are

EmpID, Cardeventdate

001 23-02-2009
002 24-02-2009

So on.., 等等..,

Dual_Protwo (Database Name)

T_Company (Table Name)

Column Names and values are

CoCode, CoName

1001 Micorsoft
1002 Dell

So on.., 等等..,

From the above two database, Table and column are different, but values are same. 在上述两个数据库中,表和列不同,但是值相同。

Here I want to take all the values from dual_Proone and dual_protwo to sysdatabase 在这里,我想将所有值从dual_Proone和dual_protwo传递到sysdatabase

My software is connecting with sysdatabase, but I need the values from dual_Proone, dual_Protwo database. 我的软件正在与sysdatabase连接,但是我需要来自dual_Proone,dual_Protwo数据库中的值。

I cannot able to change the Table name and Column names in the software, I want to take a data's from dual_Proone and dual_Protwo 我无法在软件中更改表名和列名,我想从dual_Proone和dual_Protwo获取数据

Is Possible by using trigger? 使用触发器是否可能?

Please can any one help to solve my problem 请任何人帮忙解决我的问题

Need query Help. 需要查询帮助。

In Sql Server 2005, it is possible to select from a different database useing 在Sql Server 2005中,可以从其他数据库中选择使用

ServerName.DatabaseName.dbo.Table (if it is a different server, the server must be linked.) ServerName.DatabaseName.dbo.Table(如果它是其他服务器,则必须链接该服务器。)

So you can SELECT * FORM Dual_Proone.dbo.T_person as if the table was in the same database. 因此,您可以选择* FORM Dual_Proone.dbo.T_person,就像表位于同一数据库中一样。

Have a look at this as well. 也看看这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将选定的 PostgreSQL 数据从一个数据库转储到另一个数据库 - How to dump selected PostgreSQL data from one database to other databse 如何从数据库的一个表中获取显示的数据-Drupal - How to get data displayed from one table from database -Drupal 如何从数据库中的一列中获取计算数据 - How to get calculated data from one column in database 从数据库中获取一个数据单元 - get one cell of data from database 如何将数据从具有实时IP的两台不同机器上的一个数据库复制到另一个数据库? - How to copy data from One database to another database on two different machines having live IP's? 我在 SQL 数据库中有两个表,需要从一个表中获取基于分组的数据,其他正常 - I have two tables in a SQL database, need to get data based on group by from one table and other in normal 将所有数据从一个表传输到另一个相同的数据库 - Transfering all data from one table to the other same database 模式不同时,将数据从一个数据库导入到另一个数据库 - importing data from one database to other when schemas are different 将数据从一个数据库的一个表复制到另一数据库的另一个表 - Copy data from one table of one database to onother table of other database 将数据从一台服务器上的一个数据库插入另一台服务器上的另一数据库 - inserting data from one database on one server to another database on other server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM