SQL Server allows you to join tables from different databases as long as those databases are on the same server. The join syntax is the same; the only difference is that you must fully qualify table names. Let's suppose you have two databases on the same server - Db1 and Db2 .
You just need to prefix the table reference with the name of the database it resides in. – Yuval A. Is it possible to join to different DB's, DB1 = mysql & DB2 = PostgreSQL) . Both have few common tables.
The Get External Data - Access Database import and link wizard opens. In the File name text box, type the name of the source database or click Browse to display the File Open dialog box. Click Link to the data source by creating a linked table, and then click OK. The Link Tables dialog box opens.
yes you can go for it. Need to write the schema name before the table. select Grant premission on it. Source qualifier can join tables from same db with different schemas.
Yes, assuming the account has appropriate permissions you can use:
SELECT <...>
FROM A.table1 t1 JOIN B.table2 t2 ON t2.column2 = t1.column1;
You just need to prefix the table reference with the name of the database it resides in.
SELECT <...>
FROM A.tableA JOIN B.tableB
SELECT *
FROM A.tableA JOIN B.tableB
or
SELECT *
FROM A.tableA JOIN B.tableB
ON A.tableA.id = B.tableB.a_id;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With