Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Query Builder allows creating Multi-Database Queries for those database vendors who support them (MySQL, MS SQL Server, Sybase ASE, Teradata). Multi-Database Queries are possible for the databases within a single registered server, not across different registered servers available in the Schema Browser.

To create a Cross-Database Query:

1. Ensure you are connected to a server that allows Cross-Database Queries.

2. Click the menu triangle at the top right of the Data Pane and choose [Add Database]...

Query Builder - Cross Database Query - Database ChoicesImage RemovedImage Added

3. Pick one or more of the databases from the currently connected server you wish to include in the Cross-Database Query from the [Add Database] Dialog and click click [OK].

Query Builder - Add DatabaseImage RemovedImage Added

4. The databases will be added to the Database Pane.

Query Builder - Cross Database Query - Database AddedImage RemovedImage Added

5. Click one of the databases you added. The database will highlight in blue and its tables will appear in the Table Pane. Drag one of its tables into the Diagram Pane.

Query Builder - Cross Database Query - Add TableImage RemovedImage Added

6. Click a different database in the Database Pane. The database will highlight in blue and its tables will appear in the Table Pane. Drag a table from it into the Diagram Pane. At this point, you now have two table entities in your diagram from two different databases on the same server.

Query Builder - Cross Database Query - Add Additional TableImage RemovedImage Added

7. Drag a column from the Table Entity of the first database onto a column in the Table Entity generated by the second database. Check [Database Qualified Tables] in the [Query Menu] Query Options.

Query Builder Query Options Database Qualified TablesImage RemovedImage Added

8. Notice that the SQL Pane now indicates the Multi Database query has been created and that you can see which database is the source for each table.

Query Builder - Cross Database QueryImage RemovedImage Added