Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping table between 2 databases

Status
Not open for further replies.

inarobis

IS-IT--Management
Joined
Apr 3, 2006
Messages
71
Location
CH
Hello all,

I have one question about mapping table:

So I have 2 table in two different database:

table1/database1
(id
ClientCode
age
)

table2/database2
(id
ClientName
adress
)

I would like to do a mapping table between my 2 tables in sort the 2 database can communicate together

table3
(
ClientCode
ClientName
type
)

now I would like to import it to excel

select ClientCode from table 3 where ClientCode = table2???

I have a little problem to understand that; can someone help me on that?

:) Ina

 
create a view

create view table3 as
select t1.ClientCode,t2.ClientName--,type is from which table???
from db1.dbo.Table1 t1 join db2.dbo.Table2 t2 on t1.id =t2.id
GO

then all you need to do is select * from table3 and you are done

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Thanks; The type i would like to set up by my self and I need to create a mapping table because I need to match the clientcode from one database (clientcode my mapping table = clientcode original table) and clientname from other database, there is no relation between this two database;

It is the same information (but one database set it as clientName (255) and another clientcode(50); the problem is that I would like that the two database can communicate together.

for example:

Marianne Pictet A (ClientName) et MariannP B (ClientCode)

and I would like to import the both to excel spreadsheet

Do you thing I can do it with a view or it is better a sort of bridge table?

Ina

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top