Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Article: Selecting data from different databases

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-09-04 : 11:52:55
GianMarco writes "I need to make a view that includes external data in different DB (still sql, on the same server). How can I do it? In acces I can link external table and then create my query but in Sql?"

Article Link.

redtide
Starting Member

1 Post

Posted - 2003-11-23 : 23:53:07
Any idea on how to use JOIN between tables from two different databases? The databases are on the same server. I tried to follow this syntax, but I couldn't get it to work.

Thanks in advance.
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-11-24 : 00:50:22
Did you follow the syntax correctly using a three part name?

SELECT a.col1, b.col2 FROM
database1..tablea a INNER JOIN database2..tableb b
ON a.col3 = b.col3

Also, the user must have select permissions on both tables, which also means the user must exist in both databases.

Owais


Where there's a will, I want to be in it.
Go to Top of Page
   

- Advertisement -