Simple Parameterization and Data Types

SQL Server, T-SQL
Simple paramaterization occurs when the optimizer determines that a query would benefit from a reusable plan, so it takes the hard coded values and converts them to a parameter. Great stuff. But... Let's take this example. Here's a very simple query: SELECT ct.* FROM Person.ContactType AS ct WHERE ct.ContactTypeID = 7; This query results in simple parameterization and we can see it in the SELECT operator of the execution plan: We can also see the parameter that was defined in use in the predicate of the seek operation: Hang on. Who the heck put the wrong data type in there that's causing an implicit conversion? The query optimizer did it. Yeah. Fun stuff. If I change the predicate value to 7000 or 700000 I'll get two more plans and I…
Read More

How To Speak At SQL Saturday Events

PASS, Professional Development
The PASS SQL Saturday events are meant to be a place to grow the pool of speakers, provide a mechanism for the speakers to learn, and fulfill the PASS goals of Connect, Share and Learn. So, you've decided you want to start speaking at a SQL Saturday event. Cool. You went to the <Insert Large, Popular, SQL Saturday> event last year, so you submitted this year... and didn't get accepted. Now what? First, submit. You won't get accepted if you don't try. SQL Saturday, especially the big, popular ones, may not be the best place to present for your very first time. In fact, with the large ones, you may not get accepted because people who already have a reputation are submitting to those (we all want to talk to big…
Read More

Speaker of the Month: February & March 2015

Professional Development
It's not a question of scheduling. I just haven't been to lots of community events in the last several months so that I can see community speakers and find one to give an award to. I've been trying. So, we're giving out two awards this month (my blog, my award, my rules). Unfortunately, neither one is going to a full-blown community speaker. Hey, not my fault. I'm trying. Anyway, on with the show. The first award goes to ALL the speakers on the SQL Cruise. That's Jes Borland(b|t), Jeff Lehman(L), David Klee(b|t), and Kevin Kline(b|t). Look, I get it, Tim Ford(b|t), the guy who runs SQL Cruise, goes after top speakers (and, somehow I get in too). But, until you've watched these people present, in the long form sessions that…
Read More

Monitoring for Timeouts

T-SQL
The question came up at SQL Rally, "Can you use Extended Events to monitor for query timeouts?" My immediate response was yes... and then I stood there trying to think of exactly how I'd do it. Nothing came quickly to mind. So, I promised to track down the answer and post it to the blog. My first thought is to use the Causality Tracking feature to find all the places where you have a sql_batch_starting without a sql_batch_completed (or the same thing with rpc calls). And you know what, that would work. But, before I got too deep in trying to write the query that would find all the mismatched attach_activity_id values that have a sequence of 1, but not one of 2, I did some additional reading. Seems there's…
Read More

Upcoming Events Where We Can Chat

Professional Development
I get around quite a bit. Next week I'll be visiting three cities in Germany talking to user groups in Frankfurt, Cologne and Munich on the 17th, 18th, and 19th of March, respectively. Here's the one link I can find for information. EDIT: Here's Cologne and here's Munich. Next, you can see me at the Redgate DLM Seminar in Silicon Valley on March 27th. It's a free event and there are a few seats left. Click here to register. The next day I'll be presenting at Silicon Valley SQL Saturday on March 28th. After that, I'm staying close to home to get to Boston SQL Saturday on April 18th. Then, one of the big events this year, I'll be travelling to my very first PASS Business Analytics Conference in Santa Clara, California,…
Read More

No Such Thing as a DevOps DBA

DevOps
Sjor Takes (b|t) has just barely started blogging, but he's got a great post about a discussion he had with a colleague. It's worth a read. When you get done, I'll provide my answer to the question posed at the start and conclusion of his post. I had a great discussion with one of the smarter people I know late last year. Since I'm going to disagree with this person rather vehemently, I'm going to keep them nameless. We were discussing databases and DevOps and how it relates to the developer, the data professional, specialized DBAs and businesses. It was mostly a great conversation except for this person's opening. This isn't an exact quote, but it paraphrases their beliefs fairly well: The DevOps movement is, intentionally, about getting rid of the…
Read More

How to do DevOps as a SQL Server DBA

Database Lifecycle Management, DevOps
You recognize that you need to provide a pipeline for database deployments, that you need to automate as much support for your development teams as you possibly can, that you have to have testing in place to ensure protection of the production environment, that you need to speed your processes. In short, you recognize the need for taking on a DevOps approach, an Application Lifecycle Management (ALM) approach, even, a Database Lifecycle Management (DLM) approach. Cool. Now what? Well, there are three fundamentals that you need to get under your belt. You need to get your database into source control. You need to set up a continuous integration process. You need to set up automated deployments. All tough nuts to crack. Hey, we get it. That's why Redgate Software is going…
Read More

DevOps, the DBA, and the word “No”

DevOps
Check out this DevOps Reactions animated GIF and caption. It's funny on multiple levels, but it also makes me both mad and disappointed. I get mad because it's 2015. Surely by now most of us, especially those who have worked in the enterprise with development teams, know that the old 1970s vision of a walled off data center with DBAs in white lab coats acting as gatekeepers to the data is long discredited. As DBAs, even if you're not working with development teams at all, you're just offering a service to the business. This whole, a DBAs favorite word is "NO", meme needs to die a quick, hard, death. All those "Technology X" is going to eliminate the DBA articles that come out every six months like a comet with…
Read More

Oh Look, A Horseless Carriage

Professional Development
Never forget, we're making buggy whips. And everybody we know drives little buggies and they need our buggy whips. We've got a special talent, a unique knowledge set, and it's fulfilling a defined need. So we're all set, right? Well, other than that Stanley Steamer over there. And maybe that Ford. Oh, and there's a Grant. I worry about this stuff all the time. I know SQL Server. Before that, back in the day, I worked on Paradox, PAL & OPAL. I learned and programmed in Visual Basic, Java, C# and .Net. I've made sure that I've explored, let's see, Hadoop, Mongo, MySQL, and others, structured and unstructured, relational and non, you name it. Why? Because, I want to keep an eye out for the automobiles that are going to ruin…
Read More

My First Board Meeting

PASS
Parents, you know that feeling you get after you've brought home that brand new baby (or in my case, babies) where you suddenly say to yourself, "Oh damn. What have I done?" Yeah, that's my feeling after my first board meeting. But let me give you a run-through of how it was. Note, I can't pre-publish any board decisions. I'm also not giving you a blow-by-blow account of the discussions (especially since there were no blows, at all). This is a story of the types of things we did, how it went, how I feel about it. This is my blog, my blog post, my thoughts and feelings. This does not represent an official PASS communication. We good? While the board meeting itself is, for me, only a two day affair, we tacked a…
Read More