Monday, January 26, 2009

Analysis Services MDX Templates Exploration

While looking in SQL Server Management Studio for something else entirely, I stumbled upon the Template Explorer.  This window provides Analysis Services templates for querying data mining structures (DMX), querying cubes (MDX), and performing DDL (XMLA).  I took a deeper look into the “MDX Queries” templates.

To view the Template Explorer, select the View menu > Template Explorer option.  To see the Analysis Services template, select the Analysis Services cube option at the top of the window.  Double-clicking any of the templates listed will then open a new query window containing the selected query.  For example, the Basic Query will show the following:

Select    <row_axis, mdx_set,> on Columns,
        <column_axis, mdx_set,> on Rows

From    <from_clause, mdx_name,>
Where    <where_clause, mdx_set,>

You have two choices at this point in time: selecting the Query menu > Specify Values for Template Parameters option or replacing the phrases enclosed by angle brackets manually.  The former choice opens a dialog box with all parameters listed to allow you to fill in the correct value; however, you will need to type in the full hierarchical structure by hand.  If you’re anything like me, this is bound to cause a typo and a few frustrating minutes of letter-by-letter comparison.  I prefer to modify the query directly by dragging the measure or dimensional attribute/hierarchy to my query window.  Then I don’t need to worry about mistyping anything.

While these templates will not teach you how to write MDX, they are an easy way to save yourself some typing or looking up a particular keyword that you have forgotten.  Looking over the XMLA queries, they appear to be more useful, as I am forever looking up the exact syntax for a particular XMLA query.

Versions: SQL Server 2005/2008

Thursday, January 8, 2009

SSIS Designer Tip

When designing a SQL Server Integration Services package, it can seem tedious to drag over each and every task and component from the toolbox to your Control Flow and Data Flow and connect all of the precedence constraints and pipelines. You can alleviate some of this by modifying the default Business Intelligence options within Business Intelligence Development Studio (BIDS).

Under the default settings, you can double-click any toolbox item and it will show up in your package designer with no connectors or specific place. To improve this, open up the Tools > Options... menu in BIDS. Then expand Business Intelligence Designers and Integration Services Designers. You will see Control Flow Auto Connect and Data Flow Auto Connect. If you check the option to "Connect a new shape to the selected shape by default", the drop down lists for specifying connector type and location are enabled in each menu. I prefer to use a Success constraint and add the new shape to the right of the selected shape, but you have a few options based on your design predilection.

Once these options are checked, double-clicking a toolbox item will add that item to the designer, using the options specified in the drop downs. You can of course change the type of constraint or move the item once it has been generated for you. Hopefully, this will save you a little bit of time when designing!

[Hat tip] I read about this option from Donald Farmer's great SSIS Scripting book.

Versions: Visual Studio 2005, Visual Studio 2008

Monday, January 5, 2009

Presentation References

Over the past two months, I had the honor of presenting at many user groups and conferences. I wanted to put together some information for those who attended (and for those who were unable to attend!).

If you saw either "Building Reports in SQL Server Reporting Services 2008" or "New Features of SQL Server Integration Services 2008" and are excited to get your hands on a SQL Server 2008 instance, but your company won't upgrade... you can download a free trial/evaluation version from Microsoft. Maybe you can even show your boss some of the things you learned from my presentation!

@AndyLeonard: “You got your SSIS in my Twitter!”
@JessicaMMoss: “You got your Twitter in my SSIS!”
[Previous dialogue shamelessly stolen from Brent Ozar's blog because it's a perfect lead-in to...]

For those of you who are not familiar with Twitter, it's a micro-blogging tool / social network platform that has completely taken off over the past year. Andy Leonard invited me to join in his "once-a-decade" great idea, using SSIS to write to Twitter! You can download the current version of the SSISTwitterSuite from CodePlex.

PASS puts on the largest SQL Server and Business Intelligence conference. If you attended, you can download the slides for both "SSIS Scripting" and "Building an SSIS Management Framework" (which I co-presented with Rushabh Mehta) by logging into the summit site. As an attendee, you can also purchase a DVD of all of the sessions. If you are interested in the SSIS Framework discussed during the presentation, contact Solid Quality Mentors.

This was my second time speaking at the DevTeach/SQLTeach conference in Canada, and I was thrilled to speak on SSIS, SSRS, and Data Mining in Office 2007! If you attended the conference, you can sign in and download the slides and custom component code. If you have an inkling to work with the data mining tools, check out

Finally, the SQLPASS BI SIG Data Mining webcast was recorded. Once it is available, you should be able to listen to it at:

I look forward to speaking at more events in the future!