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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked tables 2

Status
Not open for further replies.

krkX

Programmer
Nov 12, 2000
54
NL
Hi there,


Is it at all possible to link tables form one database to another..??

eg:
Database : A
Table : users

Database : B
Table : A.Users (or something like that)

Thanks

krkX
 
Oracle supports database links, which you put at the end of the tablename after an @ sign

say select * from users@a

check out your documentation for the syntax to create it.
 
Any clues how to go about with SQL Server 7..??
 
SQL server is similar to Sybase, and in Sybase you would say

select * from database..table

Try something along those line.

Greg.
 
If I understand you right, you want the data to continue to reside in database B, but to be able to reference it from database A as if it were duplicated there.

I have no claim to be an expert in SQL Server, but it seems to me that you can get what you want by defining a view (or maybe a synonym) in A that selects all rows from the table in B. The physical table would continue to belong to B, but would look to users as if it were in A. This is fairly standard SQL, so it should work in most DBMS's

create view users as (select * from b..users)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top