Adding a Data Source to a Query

Adding a Table

To add a table to a query, use the SAS Folders tree to locate the table (Metadata Table) and then drag and drop the table onto the workspace.
Tip
You can also click Search and search for the table by name and location.

Adding a Subquery

After you have designed a query and saved it, it can be used as an input data source to a new query. To add a subquery to a query, use the SAS Folders tree to locate the query (query), and then drag and drop the query onto the workspace.
The subquery is represented in the workspace by the structure of the output table.

Best Practices for Adding Data Sources

When you plan to join data sources (tables or queries), the order in which you add the data sources to the workspace matters. The first data source that is added to the workspace is automatically assigned as the left table for any joins that you add to the query.
If you are designing a query that uses a fact table and dimension tables, drag and drop the fact table onto the workspace first. You can perform left, right, or full joins with the dimension tables faster because you need to specify the join type only. However, if you drag and drop a dimension table first, you can easily use the Switch button on the Joins tab to switch the left and right tables in the join.
If you are not using a fact table or dimension tables, then the sequence for adding tables to the workspace might not be very important. Just remember that the first table dropped onto the workspace is assigned as the left table, and you can switch the left table and right table on the Joins tab.SAS Visual Data Builder takes advantage of vendor-specific features in SQL processing whenever possible. If the source tables are from a third-party vendor database, the SAS/ACCESS Interface engine can optimize the performance of the query by passing the SQL statements through to the database.