Board index » delphi » Joining tables in different databases

Joining tables in different databases


2004-01-16 02:08:07 AM
delphi260
In Delphi using ADO and MS-SQL, is there a way to join two tables from
different databases?
 
 

Re:Joining tables in different databases

"Mark Grover" <mgrover @ lgamerica.com>schrieb im Newsbeitrag
Quote
In Delphi using ADO and MS-SQL, is there a way to join two tables from
different databases?
On the same SQL Server:
SELECT *
FROM TableA TabA INNER JOIN DifferentDatabase.dbo.TableB TabB
ON TabA.somefield=TabB.someotherfield
On a different SQL Server:
SELECT *
FROM TableA TabA INNER JOIN TheOtherSQLServer.DifferentDatabase.dbo.TableB
TabB
ON TabA.somefield=TabB.someotherfield
Andreas