Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

MDX, DMX, and XMLA Templates

    One of the most underused features in SSMS is the additional templates that are available for MDX, DMX, and XMLA. Many of you probably use the T-SQL templates to quickly build common statements, but struggle with the syntx for their counterparts in these variation languages.

    Fear Not !

    If you will do this with me:

  1. Open SSMS and Go to VIEW > TEMPLATE EXPLORER
  2. Select the Analysis Cube Option (This will load the SSAS related Templates)
  3. Browse through the query options in this window
  4. clip_image001
  5. Now we have some options to use these in a couple of cool ways. First if you go to QUERY > SPECIFY VALUES FOR TEMPLATE PARAMETERS you can supply values for the templates, or you can hand code them in.

Your preference. :) These can really save you some time when working with some common MDX queries like moving average and ratios.

Comments

Posted by Bruc0Blachf0rd on 20 November 2009

This is great; thank-you.

Posted by Ayyappan on 20 November 2009

Your are a Teacher. It is a good reminder for all BI developer. You saved all of our precious time.

Posted by Gary Varga on 21 November 2009

I think a worked through example here would have really made you (valid) point.

Posted by Thomas Foster-Baker on 24 November 2009

Thank you

Posted by Christian Bahnsen on 25 November 2009

The only templates I see in my SSMS instance are under "SQL Server Templates" and I don't see Analysis Services Templates thereunder.

Do these templates need to be installed separately?  Or do they appear if one connects to an SSAS instance?  (In my case, I don't have an SSAS instance to connect to yet.)

Thanks for the tip.

Leave a Comment

Please register or log in to leave a comment.