官术网_书友最值得收藏!

Time for action – using a Named Query

Sometimes, you need to write queries instead of bringing tables and views as is from the database (assume that we don't have access to the underlying database in order to create views or change the structure of tables there). Named Query is a query that runs on the database and its result will be shown as a table in DSV. In this example, we will use a Named Query to bring the product category and subcategory along with the product table columns, by performing the following steps:

  1. In the Data Source View designer, right-click on the DimProduct table and under Replace Table, choose With New Named Query.
  2. In the Create Named Query window, add the ProductCategory and ProductSubCategory tables, and the designer will write joined statements itself.
  3. After that step, choose EnglishProductCategoryName and EnglishProductSubcategoryName from the columns list.
  4. Explore data of the DimProduct Named Query and review the result.

What just happened?

In this example, we used a Named Query and a query designer to write customized queries on the database. The query language used is T-SQL because the underlying database is SQL Server. However, it can be different based on the database.

You can also create logical keys for Named Queries or views. You can also create relationships between tables, views, and Named Queries in the DSV. These features in the DSV will provide the ability to develop a powerful base for the cube.

主站蜘蛛池模板: 罗甸县| 尉犁县| 专栏| 美姑县| 巴楚县| 曲松县| 兴和县| 平邑县| 宜丰县| 屏南县| 库伦旗| 雷波县| 固阳县| 广德县| 灵丘县| 左贡县| 福清市| 丽水市| 天全县| 武穴市| 苏尼特左旗| 宁晋县| 宜丰县| 西乌珠穆沁旗| 井陉县| 鸡西市| 故城县| 白银市| 河东区| 清涧县| 沁阳市| 大宁县| 离岛区| 勐海县| 伊宁市| 大邑县| 玉山县| 交城县| 英吉沙县| 兴文县| 胶州市|