
上QQ阅读APP看书,第一时间看更新
Isolate data sources from individual queries
In this example, a separate data source connection query is created and utilized by individual queries. By associating many individual queries to a single (or few) data source queries, it's easy to change the source system or environment such as when switching from a Development to a User Acceptance Testing (UAT) environment.
- Create a new, blank query by selecting the Blank Query data source type from the Get Data icon. The New Source icon in the Query Editor can also be used.

Figure 16: Creating a blank query
- Enter the source information into the blank query. This should follow the syntax from the Source step of the first query.
- Give the source query an intuitive name, such as AdWorksProd.

Figure 17: Data source expression used in a blank query
- Replace the Source step expression of the DimEmployee query with the name of the new query.

Figure 18: Revised expression to reference a new query
- Click on Close and Save and refresh the query to confirm that the change was successful.
- To further validate the retrieval, revise the source query to point to a separate database containing the same table. Make note of one or two differences between the tables in the two source systems, and observe the query preview change based on the parameters used in the source query.
Now make a copy of the source query and revise the source information to point to the different environment, such that you always reference either source query without manual changes.