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

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.

主站蜘蛛池模板: 汉川市| 含山县| 麻栗坡县| 广灵县| 淮北市| 苗栗县| 马公市| 德钦县| 积石山| 新田县| 岑巩县| 吕梁市| 九龙县| 科技| 乐平市| 靖安县| 渝中区| 扶绥县| 塘沽区| 南皮县| 平湖市| 郓城县| 南昌市| 济阳县| 玉山县| 嵊泗县| 宽甸| 三河市| 岳普湖县| 乌拉特中旗| 山阴县| 宣化县| 清流县| 盱眙县| 壶关县| 长白| 潮州市| 安阳市| 忻州市| 伊宁市| 渝中区|