Named Query in SSAS DSV

11
36205
New Named Query
New Named Query

Friends,

Here we are gonna discuss about Named Queries. This is one of the important property in SSAS DSV. A Named Query is nothing but a simple VALID SQL expression.  In a named query, you can specify an SQL expression to select rows and columns returned from one or more tables in one or more data sources. A named query is like any other table in a data source view with rows and relationships, except that the named query is based on an expression. The main advantage of this Named Query is that it gives you power to change the structure of tables and views that are present in data source but with out modifying the same in data source i.e the changes you are making to any object of the Database will be at DSV level only. The underlying objects in database will remain in the same condition.

Lets see a  simple example. Let’s say there are three tables table1,table2 and table3 then you can use a SQL statement which joins all the three tables and pulls only required columns and create a Named Query with it. The output of this one will become a brand new table with required columns. Lets see the steps involved in creating a named query.

1) Create a DS.

2) Create an empty DSV.

3) Right click on DSV and select New Named Query option as shown below.

New Named Query
New Named Query

4) Give some meaningful name and Add tables required or directly copy and past the query in the bottom last pane then click on OK.

Named Query
Named Query

That’s it. A new named query is created. Remember that You can use complex queries  as  well as simple queries but it should be a valid SQL expression. PFB the example for a simple Expression.

Select Getdate().

Yup, the above expression is valid to create a named query and it returns Server System current date. Hope you understood the concepts and Happy Coding Guys !!

Regards,

Roopesh Babu V

11 COMMENTS

  1. They will also be able to provide you with resources to support your child, should you prove to be pregnant and choose to keep your child.
    Pay better prices to sildenafil over the counter .Place them now!
    I am presently deciding on a phone to buy and availability of apps will help determine my options.

  2. One of the websites that I read mentioned high white blood cell count which seems to be the norm for me but no one can figure out why.
    Choose a pharmacy with good customer service to what does tadalafil look like at cheap prices
    This is particularly true for a group of Reserve Seabees who were deployed to the Gulf War theater with NMCB 24.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

forty nine − = 41