The Essential Guide to SQL Server 2008 R2 for The
Total Page:16
File Type:pdf, Size:1020Kb
Product Review: Altova DatabaseSpy 2010 p. 44 The Smart Guide to Building World-Class MayApplications 2010 A PENTON PUBLICATION Creating PowerPivot >Itzik Ben-Gan Apps in Excel Optimizing Top N Per Group 2010 Queries p. 15 p. 29 Improving the Performance of Distributed Queries p. 39 >Andrew J. Kelly 3 Solutions for Top Storage Subsystem Performance Problems p. 27 Enhance Query Performance by Using Filtered Indexes with for Sparse Columns p. 21 Server Developers p. 10 WWW.SWWW.SQLMAG.COM Contents MAY 20102 Vol. 12 • No. 5 10 COVER STORY COVER for Database Professionals —Dino—Dino EspositoEsposito VS 2010’s new code-editing features, database projects, and support for the .NET Framework 4.0 and the Entity Framework 4.0 let you more easily design and develop applications. FEATURESRES 15 Optimizing TOP N Per Group 29 How to Create PowerPivot Queries Applications in Excel 2010 —Itzik Ben-Gan —Derek Comingore Compare solutions to TOP N Per Group queries, based With PowerPivot, Microsoft is closer to its goal of on the ROW_NUMBER function, the APPLY opera- bringing business intelligence (BI) to the masses. Learn tor, and grouping and aggregation of concatenated what PowerPivot is and how to use its client-side elements. components to create a self-service BI application. 21 Effi cient Data Management 39 Improving the Performance in SQL Server 2008, Part 2 of Distributed Queries —Don Kiely —Will Alber Sparse columns can give you signifi cant storage sav- Writing a distributed query might appear to be easy ings, and you can use column sets to effi ciently update but there are many potential pitfalls. Here are some or retrieve sparse column data. Filtered indexes work strategies for avoiding problems when you’re writing with sparse columns and nonsparse columns to provide themt and tweaking them afterward. improved query performance. 27 Is Your Physical Disk I/O Editor’s Tip Affecting SQL Server Performance? Be sure to stop by the SQL —Andrew J. Kelly Server Magazine booth at Get a handle on the fundamentals of acceptable physi- TechEd June 7–10 in New cal I/O for SQL Server and learn how to determine Orleans. We’d love to hear your feedback!db k! whether it’s affecting your system’s performance. —Megan Keller, associate editor The Smart Guide to Building World-Class Applications ontents WWW.SWWW.SQLMAG.COMLMAG.CO MAYMAY 20102010 Vol.Vol. 12 • No.No 5 Technology Group Senior Vice President, Kim Paulsen C Technology Media Group [email protected] Editorial Editorial and Custom Strategy Director Michele Crockett [email protected] IN EVERY ISSUE Technical Director Michael Otey [email protected] Executive Editor, IT Group Amy Eisenberg 5 Editorial: Executive Editor, SQL Server and Developer Sheila Molnar Group Editorial Director Dave Bernard The Missing Link in Self-Service BI [email protected] DBA and BI Editor Megan Bearly Keller —Michael Otey Editors Karen Bemowski, Jason Bovberg, Anne Grubb, Linda Harty, Caroline Marwitz, Chris Maxcer, Lavon Peters, Rita-Lyn Sanders, 7 Kimberly & Paul: Zac Wiggy, Brian Keith Winstead SQL Server Questions Answered Production Editor Brian Reinholz Kimberly and Paul discuss how to size a transaction log and Contributing Editors Itzik Ben-Gan [email protected] whether moving a search argument into a JOIN clause will Michael K. Campbell [email protected] improve performance. Kalen Delaney [email protected] Brian Lawton [email protected] Douglas McDowell [email protected] 48 Brian Moran [email protected] The Back Page: Michelle A. Poolet [email protected] 6 Essential FAQs about Silverlight Paul Randal [email protected] Kimberly L. Tripp [email protected] —Michael Otey William Vaughn [email protected] Richard Waymire [email protected] Art & Production Senior Graphic Designer Matt Wiebe Production Director Linda Kirchgesler Assistant Production Manager Erik Lodermeier Advertising Sales PRODUCTS Publisher Peg Miller Director of IT Strategy and Partner Alliances Birdie Ghiglione 619-442-4064 [email protected] Online Sales and Marketing Manager 44 Product Review: Dina Baird [email protected], 970-203-4995 Key Account Directors Altova DatabaseSpy 2010 Jeff Carnes [email protected], 678-455-6146 —Michael K. Campbell Chrissy Ferraro [email protected], 970-203-2883 Account Executives Altova DatabaseSpy provides a set of standardized features Barbara Ritter, West Coast [email protected], for interacting with a wide range of database platforms at the 858-759-3377 Cass Schulz, East Coast [email protected], database level. 858-357-7649 Ad Production Supervisor Glenda Vaught [email protected] 45 Industry News: Client Project Managers Michelle Andrews [email protected] Bytes from the Blog Kim Eck Microsoft has revealed that it plans to release an SP4 for [email protected] Reprints SQL Server 2005. Find out when and where to go from here. Reprint Sales Diane Madzelonka 888-858-8851 [email protected] 216-931-9268 47 New Products Circulation & Marketing IT Group Audience Development Director Marie Evans Check out the latest products from Confi o Software, Customer Service [email protected] DCF Technologies, DB Software Laboratory, and Nob Hill Software. Chief Executive Officer Sharon Rowlands [email protected] Chief Financial Officer/ Executive Vice President Jean Clifton [email protected] Copyright Unless otherwise noted, all programming code and articles in this issue are copyright 2010, Penton Media, Inc., all rights reserved. Programs and articles may not be reproduced or distributed in any form without permission in writing from the publisher. Redistribution of these programs and articles, or the distribution of derivative works, is expressly prohibited. Every effort has been made to ensure examples in this publication are accurate. It is the reader’s responsibility to ensure procedures and techniques used from this publication are accurate and appropriate for the user’s installation. No warranty is implied or expressed. Please back up your files before you run a new procedure or pro- gram or make significant changes to disk files, and be sure to test all procedures and programs before putting them into production. List Rentals Contact MeritDirect, 333 Westchester Avenue, White Plains, NY or www .meritdirect.com/penton. EDITORIAL The Missing Link in Self-Service BI elf-service business intelligence (BI) is a great side you’ll need SQL Server 2008 R2 to get Power- Sthing—it brings the power of analysis to knowl- Pivot. Plus, you’ll need SharePoint 2010 so that you Michael Otey edge workers and decision makers who can make use can archive and manage the PowerPivot workbooks. ([email protected]) is technical director of it directly. However, after hearing Microsoft’s push On the client side you’ll need Offi ce 2010. For more for Windows IT Pro and SQL Server Magazine and author of Microsoft SQL Server on self-service BI a few times and comparing that about self-service BI, see “Donald Farmer Discusses 2008 New Features (Osborne/McGraw-Hill). vision to the reality that most businesses aren’t heav- the Benefi ts of Managed Self-Service BI,” October ily invested yet in BI, I’m sensing a disconnect. I’m 2009, InstantDoc ID 102613. concerned that there’s an implication that you can just get these new products and your BI is good to The Devil Is in the Details go. For example, there has been a lot of emphasis on The job of a Microsoft product manager is to make the SQL Server 2008 R2 PowerPivot for Excel front- new features in the product look easy and appealing. end tool (which is truly pretty cool). However, there’s However, at the same time Microsoft tends to down- more than a little hand waving over the ugly infra- play the fact that most companies aren’t early adopt- structure part in the back where all the BI data comes ers of new technologies. Plus, Microsoft likes to cre- from. It would be a bit too easy for an IT manager ate an image of a world in which customers migrate or C-title to hear about self-service BI or see a demo and quickly master their new technologies. While and think that by getting PowerPivot they’re going to some leading-edge customers fi t this image perfectly, get instant BI. Experienced DBAs and BI profession- most businesses aren’t there yet. Most companies als know it isn’t really that simple, but management prefer to be latecomers to technology. They (wisely) could easily overlook the behind-the-scenes work in adopt new technologies after most of the early issues their enthusiasm to bring BI into their organizations. have been worked out. For instance, our SQL Mag Instant Polls and your letters and feedback show Building the Back-End Infrastructure that most companies are on SQL Server 2005—not Building a BI infrastructure requires careful plan- SQL Server 2008 and certainly not SQL Server 2008 ning and design. The SQL Server 2008 R2 and SQL R2. Microsoft tends to smooth over the fact that Server 2008 Enterprise and Datacenter Editions the adoption of new technologies like PowerPivot provide the BI subsystems required to build this in- would take quite a bit of work for most companies, frastructure, but someone still has to design the data and Microsoft can downplay discussing the devil in warehouse and its SQL Server Analysis Services the details, which is the background work required (SSAS) databases. This requires an understanding of to make the demo magic happen. OLAP structures, such as cube design, as well as an awareness of the business and the types of informa- PowerPivot Is Cool, So Prep for It tion that knowledge workers will need. SSAS and the Don’t get me wrong. I think PowerPivot and the BI Development Studio (BIDS) provide the tools, concept of managed self-service BI are both ultra but the knowledge of what to build must come from cool.