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

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.

主站蜘蛛池模板: 威宁| 集安市| 孟津县| 万荣县| 新巴尔虎右旗| 景德镇市| 伊金霍洛旗| 南通市| 当涂县| 富民县| 平阴县| 长春市| 芦山县| 社旗县| 长泰县| 开原市| 惠来县| 汤原县| 神木县| 益阳市| 郎溪县| SHOW| 象州县| 太康县| 长岭县| 榕江县| 嵊泗县| 全椒县| 大姚县| 青龙| 宿迁市| 瑞安市| 呼图壁县| 岳西县| 茂名市| 志丹县| 河间市| 涡阳县| 周口市| 苏尼特左旗| 仙居县|