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

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.

主站蜘蛛池模板: 手游| 哈巴河县| 始兴县| 新乡县| 洪泽县| 广灵县| 邻水| 奉化市| 奈曼旗| 田东县| 白沙| 孝感市| 肥西县| 阿克陶县| 太康县| 遵化市| 湘阴县| 扎囊县| 嘉荫县| 达拉特旗| 陇南市| 京山县| 玉树县| 奉新县| 元谋县| 平定县| 孟连| 三河市| 定襄县| 来安县| 富锦市| 乐清市| 冀州市| 疏附县| 六安市| 营口市| 玉田县| 洛川县| 左权县| 礼泉县| 新密市|