Posts
259
Comments
464
Trackbacks
17
April 2010 Entries
Unexpected SQL Server 2008 Performance Tip: Avoid local variables in WHERE clause

Sometimes an application needs to have every last drop of performance it can get, others not so much. We’re in the process of converting some legacy Visual FoxPro data into SQL Server 2008 for an application and ran into a situation that required some performance tweaking.

I figured the Making Microsoft SQL Server 2008 Fly session that Yavor Angelov (SQL Server Program Manager – Query Processing) presented at PDC 2009 last November would be a good place to start. I was right.

SS2008Fly_1

One tip among the list of incredibly useful tips Yavor presented was “local variables are bad news for the Query Optimizer and they cause the Query Optimizer to guess”.

What that means is you should be avoiding code like this in your stored procs even though it seems such an intuitively good idea.

DECLARE @StartDate datetime
SET @StartDate = '20091125'
SELECT * FROM Orders WHERE OrderDate = @StartDate

Instead you should be referencing the value directly in the WHERE clause so the Query Optimizer can create a better execution plan.

SELECT * FROM Orders WHERE OrderDate = '20091125'

My first thought about this one was we reference variables in the form of passed in parameters in WHERE clauses in many of our stored procs. Not to worry though because parameters ARE available to the Query Optimizer as it compiles the execution plan.

I highly recommend checking out Yavor’s session for additional tips to help you squeeze every last drop of performance out of your queries.

Have a day. :-|

Posted On Friday, April 30, 2010 3:09 PM | Comments (1)
Microsoft Silverlight 4 Data and Services Cookbook – Book Review (sort of)

I just received my copy of the Microsoft Silverlight 4 Data and Services Cookbook, co-authored by fellow Microsoft Regional Director, Gill Cleeren, and at first glance I like what I see. I’ve always been a fan of the “cookbook” approach to technical books because they are problem/solution oriented. Often developers need solutions to solve specific questions like “how do I send email from within my .NET application” and so on, and yes, that was a blatant plug to my article explaining how to accomplish just that, but I digress. :-) I also enjoy the cookbook approach because you can just start flipping pages and randomly stop somewhere and see what nugget of information is staring up at you from the page.

Anyway, what I like about this book is that it focuses on a specific area of Silverlight development, accessing data and services.  The book is broken down into the following chapters:

Chapter 1: Learning the Nuts and Bolts of Silverlight 4
Chapter 2: An Introduction to Data Binding
Chapter 3: Advanced Data Binding
Chapter 4: The Data Grid
Chapter 5: The DataForm
Chapter 6: Talking to Services
Chapter 7: Talking to WCF and ASMX Services
Chapter 8: Talking to REST and WCF Data Services
Chapter 9: Talking to WCF RIA Services
Chapter 10: Converting Your Existing Applications to Use Silverlight

As you can see this book is all about working with Silverlight 4 and data. I’m looking forward to taking a closer look at it.

Have a day. :-|

Posted On Wednesday, April 28, 2010 11:48 AM | Comments (0)
Very Cool – Miami 311 System for tracking citizen service requests (Windows Azure, Silverlight & Bing Maps)
Having grown up in South Florida this short, but very enlightening, video explaining how the City of Miami has implemented a 311 citizen service request system using Windows Azure, Silverlight and Bing Maps definitely caught my attention.
Miami311

The Miami311 System is a Windows Azure/Silverlight-based solution which enables City of Miami citizens report and track issues reported to city management. The system uses Bing Maps to plot the location and relevant information about each issue reported. Citizens now have the ability to easily see the status of the issue without having to call the city office.

What I found interesting were a couple of benefits that a metropolitan area such as Miami can take advantage of in Windows Azure cloud-based solution. For the city of Miami, both benefits center around the weather. Of course the threat of a hurricane is a real issue in South Florida and what better way to make sure your site stays up during a hurricane then to have the site hosted far away from the eye of the storm. Using a Windows Azure cloud-based architecture the City of Miami is able to host the application within the Microsoft data centers safely away from any hurricane passing through South Florida.

The second benefit is the inherent scalability of a Windows Azure based solution. During a severe weather event like thunderstorms or even worse, a hurricane, downed trees and power lines are a commonly reported problem. Being able to quickly scale up the computing resources required to handle the spike in citizens reporting these types of problems on the site is a huge benefit. Once the weather event has passed and downed tree reports begin to subside they can quickly reverse the process and scale the system back down to pre-storm levels.

It’s kind of day-to-day kind of stuff but very cool stuff nonetheless.

Have a day. :-|

Posted On Tuesday, April 27, 2010 8:02 PM | Comments (0)
Time Travel 101 or Learning Stuff Faster by Speeding Things Up!

I’m thinking maybe I should have used Time Crunching 101 as the title instead… or maybe ‘Duh Duffy, where have you been? Everyone knows that!”

Ok, so maybe you won’t actually learn how to travel through time from this post but you will learn how to cram more learning into one day. We all know you can’t make it to every conference, every presentation, or every training session. The good news is that many of those events make their content available to either watch online or to download for off-line viewing. The problem is who has time to sit and watch all those presentations in real time? Not me. One trick I use is to view the content at an increased play rate. Why listen to a boring speaker like me drone on for the entire length of the session when you can listen to them drone on in almost half the time. :-)

I view nearly all off-line content with Windows Media Player though I’m sure you can implement this idea with any media playback software. The idea is changing the playback speed you view the content at. With Windows Media Player you can change the play speed from the menu system.

WMP_Menu

Once you have the Play Speed Setting panel open you can specify the playback speed. Depending on the content and the presenter I can typically listen between 1.6 and 2.0 times normal speed.

WMP_PlaySpeedSettings

My Florida edumacation taught me that playing the video back at twice the speed means I’ll listen to it twice as fast and that means I can view it in almost 1/2 the time.  Too bad it won’t make me twice as smart. :-)

I hope this helps you speed your way through more training content.

Have a day. :-|

Posted On Tuesday, April 27, 2010 4:53 PM | Comments (0)
Introduction to Microsoft SQL Azure: Free self-paced Microsoft class

Here is a wonderful opportunity to take advantage of some FREE Microsoft Learning content on SQL Azure. This self-paced 2 hour class is broken down into 4 segments each with a self test at the end.

Class Segments

1) Understanding the SQL Azure Platform

2) Designing Applications for SQL Azure

3) Migrating Applications to SQL Azure

4) Achieving Scale with SQL Azure

If you’re getting started with Windows Azure or have been working with it for a while and need to take advantage of the storage capabilities offered by SQL Azure this is going to be a great place for you to start learning.

Have a day. :-|

Posted On Tuesday, April 27, 2010 12:58 PM | Comments (0)
MSDN Video: Windows Phone 7 in 7: Silverlight and Windows Phone 7

Looking for a quick introduction to developing applications on Windows Phone 7? I found just the thing then. Check out this short 7 minute MSDN Video titled Windows Phone 7 in 7: Silverlight and Windows Phone 7.

I liked the direct and to the point nature of the video. Like the title implies, it’s less than 7 minutes long and provides just enough information to start laying a solid foundation to start learning more about Windows Phone 7 development.

Have a day. :-|

Posted On Tuesday, April 27, 2010 12:46 PM | Comments (0)
Visual Studio 2010 Launch Events

Don’t miss out on the opportunity to learn about the new features in Visual Studio 2010. Check out the MSDN Events page and find out when the talented folks of the Developer & Evangelism group will be visiting your city to prove to you that /*Life Runs On Code*/.

I’ll be attending the Raleigh event June 2, 2010 from 1:00 - 5:00 PM.

North Carolina State University, Jane S. McKimmon Conference Center

1101 Gorman St
Raleigh North Carolina 27606
United States

From the Raleigh Event page:

Event Overview

Learn about the rich application platforms that Microsoft® Visual Studio® 2010 supports, including Windows® 7, the Web, SharePoint®, Windows Azure™, SQL®, and Windows® Phone 7 Series. From tighter tester and dev collaboration to new ALM tools, there’s a lot that’s new. Here’s what you can expect:

Windows Development with Visual Studio 2010

Visual Studio has always been the best way to build compelling visual solutions for Windows. Visual Studio 2010 continues this trend with great new tooling support for Silverlight 4, WPF, and native development. In this demo heavy session, you’ll see how you can build rich Windows applications with Silverlight 4 using new trusted application features including out-of-browser execution, saving to the file system, and even COM Automation. You’ll also see how you can use the new Task Parallel Library from within a WPF application to take advantage of all those cores in today’s modern computers.

Web and Cloud Development with Visual Studio 2010

If you build solutions for the web, then this session is for you. Come see how your existing skills move forward with Visual Studio 2010 both for in-house ASP.NET development and the new frontier of the Cloud. In this session, you’ll see improved designers, new HTML and JavaScript snippets, Web Forms enhancements, and how you can quickly build great web sites using Dynamic Data. You’ll see the changes made to testable web sites with MVC 2.0 and how we’ve integrated JQuery support into the platform. You’ll then see how easy it is to leverage your existing code and move to the cloud with Windows Azure.

Windows Phone 7 Developer Tools and Platform Overview

This session provides an overview of Visual Studio® 2010 for Windows Phone. Learn about the powerful capabilities of this new application platform and the developer tools experience including basic IDE usage, debugging, packaging, and deployment. This session also shows how you can use Microsoft Expression® Blend™ for Windows Phone to build great Silverlight applications.

Have a day. :-|

Posted On Monday, April 26, 2010 4:59 PM | Comments (0)
ASP.NET MVC for the Rest of Us Videos now available

Microsoft Senior Program Manager, Joe Stagner, has released his first 3 ASP.NET MVC for the Rest of Us Videos. I like the way he helps you learn ASP.NET MVC by building bridges between ASP.NET MVC concepts & ideas and ASP.NET WebForms concepts & ideas which you may already be comfortable working with. Good job Joe.

Have a day. :-|

Posted On Monday, April 26, 2010 12:17 PM | Comments (0)
Gems In The Visual Studio 2010 Training Kit - Introduction to ASP.NET MVC: Learning Labs

Following up on my prior “gems post” is another nugget I found in the Visual Studio 2010 and .NET Framework 4 Training Kit.

ASP.NET MVC has established quite a bit of momentum in the ASP.NET development community since it was introduced in early-ish 2009 though I’m sure there are many developers who haven’t had the time or opportunity to find out what it is, not to mention learn how to use it. If you’re one of those “I’ve heard of it but I’m not sure what it really is” developers then I suggest you start your research here.

Ok, back to the gem. There are a number of fantastic MVC learning resources out there including the video tutorials on the ASP.NET MVC website. Another learning resource for your journey along the yellow brick road into ASP.NET MVC land are the hands-on learning labs contained in the Visual Studio 2010 and .NET Framework 4 Training Kit. These hands-on exercises walk you through the process of creating the “M”, the “V”s, and the “C”s of ASP.NET MVC and help you gain a solid foothold into the details of creating and understanding ASP.NET MVC applications.

Have a day. :-|

Posted On Monday, April 26, 2010 11:56 AM | Comments (0)
Gems In The Visual Studio 2010 Training Kit – Introduction to MEF: Learning Labs

No, this post doesn’t have anything to do with cooking up illegal drugs in some rundown shack outside of town. That, my friends, would be a meth lab and fortunately that is waaaaay outside my area of expertise. Now I can talk Kentucky bourbon, or as Homer Simpson would say “mmmmmmmmmmm bourbon”, with you but please refrain from asking me meth questions. :-)

Anyway, what I’m talking about are the MEF (Managed Extensibility Framework) Learning Labs contained in the Visual Studio 2010 and .NET Framework 4 Training Kit.

Not sure what MEF is and need an overview? Then start here or here.

Ok, so you’ve read a bit about MEF or heard about MEF and you’re thinking it might be something you and your development team might want to take a hands-on look at. I have good news then because contained in the Visual Studio 2010 and .NET Framework 4 Training Kit is a series of hands-on learning labs for MEF. I’ve added working my way through them to my “things I want to take a closer look at” list.

Have a day. :-|

Posted On Monday, April 26, 2010 11:35 AM | Comments (0)
The Silverlight 4 Training Kit and Green Eggs & Ham

Microsoft has released the Silverlight 4 Training Kit that steps you through the process of constructing Silverlight 4 business applications.

“The Silverlight 4 Training Course includes a whitepaper explaining all of the new Silverlight 4 features, several hands-on-labs that explain the features, and a 8 unit course for building business applications with Silverlight 4. The business applications course includes 8 modules with extensive hands on labs as well as 25 accompanying videos that walk you through key aspects of building a business application with Silverlight. Key aspects in this course are working with numerous sandboxed and elevated out of browser features, the new RichTextBox control, implicit styling, webcam, drag and drop, multi touch, validation, authentication, MEF, WCF RIA Services, right mouse click, and much more!”

What I think is pretty cool is that there are two ways to access this content, online and offline. Obviously the online version is great when you’re sitting at your desk and you’re connected to the web. What about when you don’t have a connection like when you’re located where you won’t eat green eggs & ham, like on a train or on plane perhaps? :-) You can download the offline version and hope that Sam I Am won’t be to distracting while you try to watch the videos or work your way through the labs. :-)

Have a day. :-|

Posted On Monday, April 26, 2010 11:03 AM | Comments (0)
.Net Rocks Visual Studio 2010 Road Trip coming to Raleigh, NC May 6th

Listen up .NET developers within 50 miles of Research Triangle Park, NC!  Take out that red, blue, green, black or any other color Sharpie marker you fancy and circle May 6th! Fellow Microsoft Regional Directors Carl Franklin and Richard Campbell are going to be bringing the .Net Rocks Visual Studio 2010 Road Trip to town. What’s that you say, you’ve never been to a .Net Rocks Road Trip event and don’t know what to expect? Let me help with that. I stol… uhhh… I mean I was “inspired” by some content I found on the event information page.

“Carl and Richard are loading up the DotNetMobile (a 30 foot RV) and driving to your town again to show off their favorite bits of Visual Studio 2010 and .NET 4.0! Richard talks about Web load testing and Carl talks about Silverlight 4.0 and multimedia.

And to make the night even more fun, we’re going to bring a mystery rock star from the Visual Studio world to the event and interview them for a special .NET Rocks Road Trip show series.

Along the way we’ll be giving away some great prizes, showing off some awesome technology and having a ton of laughs.

So come out to the most fun you can have in a geeky evening – and learn a few things along the way about web load testing and Silverlight 4!“

 

I know I’ll be there so what are you waiting for? Head over to the event registration page and sign up today!

Have a day. :-|

Posted On Saturday, April 24, 2010 3:43 PM | Comments (0)
Best Practices on Building SharePoint 2010 Web Parts with Visual Studio 2010

In this Channel 9 interview, my good friend Beth Massi recently sat down with Boris Scholl, a Program Manager on the Visual Studio Team building tools for SharePoint development, to discuss the best practices for building SharePoint web parts with Visual Studio 2010.

SharePoint developers upgrading to Visual Studio 2010 might want to check this out.

Have a day. :-|

Posted On Saturday, April 24, 2010 12:43 PM | Comments (0)
Visual Studio 2010 and .NET Framework 4 Training Kit

Now that you’ve had time to download and install Visual Studio 2010 its time to start learning about all the new features and capabilities. That’s where this post comes in. Microsoft released the Visual Studio 2010 and .NET Framework 4 Training Kit on the same day Visual Studio 2010 became available to download.

It contains presentations, hands-on labs, and demos on a variety of features and framework technologies including:

  • C# 4
  • Visual Basic 10
  • F#
  • Parallel Extensions
  • Windows Communication Foundation
  • Windows Workflow
  • Windows Presentation Foundation
  • ASP.NET 4
  • Windows 7
  • Entity Framework
  • ADO.NET Data Services
  • Managed Extensibility Framework
  • Visual Studio Team System

As you can see the Developer & Platform Evangelism group has gone the extra mile to make sure you have the resources you need to fully leverage the power of Microsoft’s latest version of Visual Studio.

Have a day. :-|

Posted On Saturday, April 24, 2010 12:24 PM | Comments (0)