Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By : Abolfazl Radgoudarzi, Reza Rad
Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By: Abolfazl Radgoudarzi, Reza Rad

Overview of this book

Table of Contents (19 chapters)
Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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...