Query tables across multiple databases with sql

From: chris (chris_at_discussions.microsoft.com)
Date: 08/24/04


Date: Tue, 24 Aug 2004 12:57:03 -0700

Hello:

How do I write an sql statement to link tables in two databases and query
them?
For example:

SELECT db1.table1.field1, db2.table1.field1 FROM Table1 INNER JOIN
db1.table1.field1 ON db2.table1.field1 = db1.table1.field1

This is for SQL Server 2000. Thank you.



Relevant Pages

  • Re: Date Error in linked tables query
    ... Another thought: Make sure the Name AutoCorrect boxes are unchecked under: ... > Could you try it as a Pass Through query? ... Alternatively, create a View in SQL Server, and link the view? ... >> SQL Statement is at top with resulting records below, ...
    (microsoft.public.access.queries)
  • Re: Error using " in .open with ADODB.Recordset
    ... recordset but I'm getting hung up on the SQL statement. ... query that has a string as a condition. ... Dim mrk As String ...
    (microsoft.public.data.ado)
  • Re: expiration
    ... First what type of field are you applying the criteria against? ... You can try the following in a query. ... If you are trying to get just records with the License has expired within ... it is the actual SQL statement that is executed. ...
    (microsoft.public.access.queries)
  • Re: Same date range in main and sub form
    ... You need to concatenate together the parts to make up the SQL string ... it will look like the SQL statement you original ... Allen Browne - Microsoft MVP. ... well as the name of the query on which the form is based. ...
    (microsoft.public.access.forms)
  • Re: expiration
    ... If you are trying to get just records with the License has expired within ... In the Design view of the query ... This query is based off the existing employee database created by someone ... it is the actual SQL statement that is executed. ...
    (microsoft.public.access.queries)