Understand the True Source of Problems

SQL Server, T-SQL
There's an old joke that goes, "Doctor, doctor, it hurts when I do this." While the person in question swings their arm over their head. The doctor's response is, "Don't do that." Problem solved, right? Well, maybe not. Let's take a quick example from life. I do crossfit (yeah, I'm one of those, pull up a chair I'll tell you all about my clean & jerk progress... kidding). I've been experiencing pain in my shoulder. "It hurts when I do this." But, I'm not going to stop. I've been working with my coach to identify where the pain is and what stretches and warm-ups I can do to get around it (assuming it's not a real injury, and it isn't). In short, we're identifying the root cause and addressing the…
Read More

Two Weeks on the PASS Board

PASS
The one absolute promise I made about serving on the PASS Board is that I would let you know what I was doing there. Well, we're two weeks in and I figured now was a good time for a report. Next week is my first board meeting (and I will report back on how that goes). I'll be presenting the goals I've worked up for the Chapters and see how many of them we can get approved and then how many of them we can deliver. In the time I've had on the board so far, a big part of what I've been doing is learning about what has gone before. What kind of goals did we have for last year. Which of them were delivered. Which weren't. Why. What's…
Read More

Common Table Expressions Are Not Tables

T-SQL
There's power in naming things. Supposedly some types of magic are even based on knowing the correct names for things. The name for the T-SQL clause Common Table Expression (CTE) is actually pretty accurate. It's an expression that looks like a table and can be used in common across the entire query (at least I think that's what the common part refers to). But note, I didn't say it was a table. It's not. It's an expression. If you look at the T-SQL definition at the link, it refers to a "temporary" result set. Now, to a lot of people, that means table. But it isn't. Let's look at this in more detail. Here's a query that defines a simple CTE and then uses it to query the date in the…
Read More

I Am Grateful For

Professional Development
A while back I wrote about saying "Thank you" to people. Last night I was listening to NPR on my ride home from a great New England SQL Server User Group meeting (yes, I listen to NPR). Two different reports came on during my ride that got me thinking again about my previous blog post. The first talked about how negative emotions directly impact your ability to make rational decisions. They've found that people actually spend more money on items when they're depressed than they do when they're happy. There's a bunch of research around it, but I missed where it was published. It was a great discussion. They found that getting yourself into a positive mood directs your focus outwards rather than inwards. One of the best ways to get that…
Read More

Execution Plans, Performance Tuning and Rum

Misc
[caption id="attachment_2827" align="alignleft" width="150"] This is me on the last cruise[/caption] In just a few more weeks I'll be setting sail on the first of two SQL Cruise events this year. I'm honored beyond my ability to appropriately express it to be included as one of the Technical Leads for both the cruise in February (7-14, 2015, I think there's a seat or two left) to the Caribbean and the one in June (14-21, 2015, definitely a couple of seats left) to the Mediterranean. Lest you think that this is just an excuse to hang out and drink, you ought to know a little about how sessions are presented on the cruise and the sessions I'm presenting. Don't mistake sessions on the boat for your typical one hour session at…
Read More

Speaker of the Month: January 2015

Professional Development
I love it that my first post of the new year is going to be Speaker of the Month. I'm really enjoying doing these because I'm getting to attend a lot more sessions at the events I go to in order to get choices. But, please, don't bug me. If I can attend your session, I will. If I can't... Anyway. Speaker of the Month for January 2015 is William Wolf (b|t) and his session "Common Coding Mistakes and How to Mitigate Them" that was delivered at SQL Saturday DC. This was a good session. It was informative. I really liked how Bill (I'm going to use that because it's easier to type and despite looking like the Demon Biker of the Apocalypse, he's a bigger sweetheart than I am) kept…
Read More

“Pretty Plans vs. Performance” or “Grant Gets Pwned”

SQL Server
If you get an execution plan that looks like this: I wouldn't blame you for immediately thinking about query tuning. Especially if the code that generated it looks like this: SELECT soh.OrderDate, sod.OrderQty, sod.LineTotal FROM Sales.SalesOrderHeader AS soh INNER JOIN Sales.SalesOrderDetail AS sod ON sod.SalesOrderID = soh.SalesOrderID WHERE soh.SalesOrderID IN (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50, @p51, @p52, @p53, @p54, @p55, @p56, @p57, @p58, @p59, @p60, @p61, @p62, @p63, @p64, @p65, @p66, @p67, @p68, @p69, @p70, @p71, @p72, @p73, @p74, @p75, @p76, @p77, @p78, @p79, @p80,…
Read More

Speaker of the Month: December 2014

Professional Development
For the month of November I was at the PASS Summit and Live360, so I didn’t get to find new speakers to see (heck, I didn’t get to see any sessions at Summit this year). But, that didn’t mean I didn’t get to see great speakers. I did (Rimma! Rimma! Rimma!). Live360 had some amazing presentations. I do like the mixed events like Live360 because I enjoy crossing into dev sessions as well as database sessions. My speaker of the month for December 2014 is Bradley Ball (b|t) and his session “Inside the Query Optimizer” Oh, before I go any further: HEY BALLS! Sorry, but Brad had us do that at the start of the session. I figured I’d just carry it on. Anyway, wow. What a great session. Brad’s delivery…
Read More

Speaker of the Month: November 2014

Professional Development
I have been very remiss in my blogging of late. Apologies. One thing I haven’t blogged about is Speaker of the Month. I’m behind. So, I’ll be posting two of them over the next few days in order to catch up. First up, Speaker of the Month for November. I went to quite a few events in October, but I actually didn’t get to see too many sessions. However, the few I saw were actually quite good. Speaker quality is just going up and up. I finally got to see someone present that I’ve known for years and years, but just never had the opportunity to sit in on a class. Well, I sat in on one, and this is the result. My speaker of the month is Kathi Kellenburger(b)…
Read More

PASS Summit 2014 Speaker Idol

PASS
For the first time ever at the PASS Summit, a competition was held to select a speaker for the 2015 Summit. This competition was organized and run by Denny Cherry. You can read all about what he thought of the event right here. I was asked to take part as a judge. I was on the panel for all the preliminaries and then sat in the room for the final. Here's what I thought of the event. First off, thank you to the PASS organization for taking a chance. This is a deviation from the way things have been done. Trying new things can be difficult, but the organization stepped right up and supported this addition to the rich pageant that is the Summit. Second, I want to thank Denny…
Read More