THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Louis Davidson

  • Why We Write #5–An Interview With Jason Strate

    My next guest is a person I have known for years, and have worked with on several occasions, Jason Strate (@stratesql). Jason is a very active writer and speaker (at my first SQL Saturday event, he spoke four times!), and always seems very busy. His blog (jasonstrate.com) had 23 posts just last month, and his twitter account is always active with interesting SQL and non-SQL tweets.

    If the blogs and tweets weren't enough, just this past year, Jason was a coauthor on one book last year (Expert Performance Indexing for SQL Server 2012), contributed to another (Pro SQL Server 2012 Practices), and is credited as a tech editor on yet another (Professional Microsoft SQL Server 2012 Administration), and if all this wasn’t enough, published an kindle eBook about SSIS (31 Days of SSIS with SQL Server 2008 R2).

    I look forward to seeing Jason's answers to my interview, as he is probably the most driven writer I know, so I expect his answers will get me that much closer to the understanding of why we writers do what we do...

    ------------------------------------------------------

    1.  There was a point in time when you didn't have a blog, didn't tweet, and probably had no public presence whatsoever. And then, one day, you made the decision to put yourself out there. What prompted you to get started writing?

    When I first started writing it was basically a way for me to read something at home, then catalogue it for ease of access when I got to work.  Often it was just a link with an explanation to why I thought it was interesting.  Other times, it would be a script with the tweaks I had made - blogged just for safe keeping.  I did this for a number of years without any knowledge of whether people were reading the posts, I was just keeping a running collection of notes.

    At some point, about 10 years ago, I watched a webcast that Kimberly Tripp had put together on index fragmentation.  One of the big take-aways that I got from the presentation was that someone was able use sharing of information as an aspect of their career.  Color me naive, but the idea of writing serious articles, or posts, hadn't occurred to me prior to that point.  Afterwards, I started putting a little more effort and aim into the posts that I was writing.  Because an with audience for a fragmentation video, there was surely an audience for something I could write.

    2. We all have influencers that affect our trajectory as a writer. It may be a teacher who told you that you had great potential, or another writer who impressed you that you wanted to be like? Or perhaps on the other end of the spectrum it was a teacher who told you that you were too stupid to write well enough to spell your own name, much less have people one day impressed with your writing? Who were your influences that stand out as essential parts of your journey to the level of writer you have become?

    I wish I had a really good story here.  There is no oppression from teachers or inspiration that bestowed on me, I basically kept my head down while serving time in the educational system.  The only impression that school left me with was that writing wasn't important in life and if you made a career of it, you better be prepared to poor for a long time.  So uplifting, but it would be no surprise that from an early age I didn't see the value in writing.

    Now, I did have an influencer in my 20s that did get me started on the path of self-improvement that has to be noted.  And while it isn't specifically a writing influencer, he did get the mud moving to help me re-envision what was possible.  This was my friend Steve Coyle, for most of my 20s he was a constant friend that was always there to talk about how we could help motivate each other to move forward.  He was the first person I met that explained to me the value in networking.

    As I mentioned, my original inspiration was from Kimberly Tripp.  She was also an influencer, along with a lot of people that readers already know.  These include Louis Davidson (editor note: who?), Kevin Kline, Denny Cherry, Thomas LaRock, Brent Ozar, Paul Randal, Grant Fritchey and Jonathan Kehayias.  As I've grown in my writing, I've watched how they write and looked to ideas on how to improve how I write. 

    In the past couple years, I've started looking outside the SQL Server community to find new influencers.  This has brought in a few new names.  One is Darren Rowse, who wrote the ProBlogger books, he's has had a lot of influence on how I put topics together.  It's helped me find not just ideas to write about but ways to package them to attract readers.  There's also Tim Ferris and Leo Babuata - who are fairly opposite self-help authors.  One thing I've started to realize is the need to be influenced and seek improvement across my entire spectrum of interests, because it helps raise the level of everything and raising the heights that I can take my writing and life.

    3.  As the years pass, how has your writing changed?  Do you feel like it is becoming a more natural process? Or perhaps you get more critical of your own writing to the point that it takes you longer?

    There are a few ways my writing has changed over the years.  One of the first big changes was transitioning from just posting code and links to explaining the value and purpose for that content.  This led to an increase in the length of posts and the depth of the topics.   Ever since I wrote the indexing book, my writing has really changed.  I've become a lot better at drawing connections between what I write and the images and scripts included in posts.  I try to explain everything, which makes for some really long posts.  But that problem has been solved with the idea of breaking posts into multiple topics. 

    I am probably more critical of my posts that I used to be, but not overly critical.  I really like to make certain that in every post, from the question or idea proposed to the conclusion, that there is a clear linear path of logic.  I often use Sarah, my wife, as a reviewer for posts to be sure that, while she may not understand the content, does the logic of the conversation flow from beginning to end.  She likes to point out that I don't use enough commas.

    4. Assume a time machine has been created, and you are allowed to go back in time to speak to a group of potential writers, in which you and I are in attendance. What would you tell "past us", and do you think that your advice would change where you and I are in our careers now?  Like would you tell yourself that one day you would be sitting here for a rather long period of time answering interview questions and not getting paid for it, instead of doing something else?

    Given the chance, I would like there are a few things I would have impressed upon an early group of writers.  First, make sure you are writing under some form of branding from the start.  I've been blogging on www.jasonstrate.com for only about three years.  Everything before that had moved from time to time between probably five or six different hosts and platforms.  Often, I'd build and then abandon my audience without knowing it. 

    Next, spend some time really developing the blog posts.  They don't need to be masters of art.  But they need to have an opening, body, and closing.  It was years before I got to that point - which had been hammered in while in school.  It was a long time before I realized, that it made a difference in blogging. 

    And since you're working on developing your writing, use the blog to explain something, not just share things you find.  Got a cool script - fine, post it - but also write down why it is cool and should be used.  When I started explaining things, more people started to care about what I was writing down.

    Finally, figure out how to write on a regular basis.  At least once a week.  If you're writing on a blog, its meant for an audience.  If you aren't writing weekly or at least a few times a week, what is going to motivate an audience to stick around or come back.  There are so many voices in the world today, that yours needs to stick around if you want it heard. 

    I'm not sure I would have listened, but it would have been cool to have gotten that advice.  I'd like to think that had that happened, I'd probably have shaved 3-5 years off the progress it took to get to where I am now.

    5. Finally, beyond the "how" questions, now the big one that defines the interview series. Why do you do write?

    There are a few driving forces behind why I write.  First, I'm naturally curious.  When I was a kid, picking up an encyclopedia for a single topic always meant I would read a few others.  Writing about SQL Server to me is part of that curiosity, when I hear a best practice, I want to check it and verify it.  I want to see that it actually happens and understand what's going on.  Along with that, writing helps me organize my curious endeavors.

    I also write for other people.  Those that read what I write about and gain something, that's a big motivator.  I'm often astounded when people are excited to hear my thoughts on something or happy that I get to come out to their company and provide mentoring.  Because to me, I'm the guy who licked a telephone line once to see if it gave off more or less of a jolt that a 9-volt battery (the answer is more) - and me giving advice is an often humorous turn of events.  But, back to the other people, that I write for...

    Probably the best answer is a quote from the movie Groove:

    Guy: Why do you do this to yourself? Don't even get paid, risk getting arrested, for what?

    Ernie: You don't know?

    Guy: No.

    Ernie: The Nod.

    Guy: The Nod?

    Ernie: Happens to me at least once every party. Some guy comes up to me and says "Thank you for making this happen... I needed this. This really meant something to me." And they nod... and I nod back.

    Guy: [scoffs] ... That's it?

    Ernie: That's it.

    Bonus Question: Are there any projects coming up that you would like to tell people about?

    The most exciting upcoming project I have has to do with where I want to take my blog.  I've got a number of posts that people really like.  But writing isn't always the best platform for everyone that may be interested in those topics.  My plan is to start recording webcasts in the 5 to 10 minute range that encapsulate those posts and deliver them in a new manner.  I'm hoping this will help me expand my audience.  Also, I'm hoping it'll help me write better since it will force me to evaluate a lot of old posts - and possibly re-write a few of them.

    ---------------------------------------------

    Excellent…simply excellent. I love the answer to the why question. I am personally very shy, so I would have NEVER have met any of the people I have if I had never started writing, blogging and speaking, so I identify with that a bit.

    As for my question for “the” answer to the time machine question that will trigger me writing my own interview answers, Jason was way off that mark, with much more interesting answers. Branding is a great idea, but even if you don’t feel like that is for you, stick with the platform you have where-ever, and probably only move once and for a good reason. That is why I have my blog still on sqlblog.com. It is a good group of bloggers, I really like Adam Machanic and Peter DeBetta (though I haven’t seen him since he drank the blue Kool Aid a few years back), and I get more hits than I could on my own. Same with some of my simple-talk work, Tony Davis and Andrew Clarke edit my work and gives it a professional air that I could never.

    The note about working on the blogs for a while is great too. For my What Counts For a DBA series of blogs on simple-talk, I try to treat that a bit like art, and really work for hours to hone them. For my technical posts, I am a lot freer with the text, but spend as much time as I can testing the code I put out, doing my best to make sure that the query I post works not only for my server usage, but for any server usage I can think of. Writing only what you have used in production is a great disservice to your readers because you don’t do everything. You might present an idea, but if you want to state definitively that solution X is the the best solution, you had better have tried A-W and Y and Z too.

    Anyhow, next up is another friend of mine who has been influential in many of the members of the SQL Server Community. Kevin Kline. Till next time, I hope these posts inspire you to become my 100th subject in a few years (and will answer the inspiration in just that way, naturally!)

  • Speaking about Relational DB Design the next two weeks (Knoxville, then Atlanta)

    On Friday, May 10 I will be speaking for the Knoxville SQL Server User Group, and on May 18, I will be speaking at SQL Saturday in Atlanta. Both days, my session is my old chestnut “Database Design Fundamentals”. It is my favorite session to do because of two things. 1. I love to talk about database design 2. No demos :).  The abstract is:

    In this session I will give an overview of how to design a database, including the common normal forms and why they should matter to you if you are creating or modifying SQL Server databases. Data should be easy to work with in SQL Server if the database has been organized as close as possible to the standards of normalization that have been proven for many years. Many common T-SQL programming "difficulties" are the result of struggling against the way data should be structured and can be avoided by applying the basic normalization techniques and are obvious things that you find yourself struggling with time and again (i.e. using the SUBSTRING function in a WHERE clause meaning you can't use an index efficiently).

    It is a session that I haven’t done in short form since PASS 2011, and submitting this as a session was one of my resolutions this year, because it is truly my favorite regular session (my second favorite session is the precon version, because we get to spend a good amount of time on the subject.)

    Additionally, at SQL Saturday Atlanta, I will be doing a lunch session for Red-Gate called: What Counts For a DBA: Observant. It is a session that is 33% professional development, 33% about where to find info about your server, 33% about monitoring your server and 11% demo of the SQL Monitor (and a lack of math skills is part of the show.) This is not the normal advertisement session, I wrote it myself, but is intended to be useful to anyone immediately without buying their tools, and to show you how Red-Gate’s tools can assist in observing your server’s behavior

  • Why We Write #4 - An Interview With Doug Lane

    My next guest is Doug Lane, who has been blogging for the past few years on his website: http://www.douglane.net/. Doug is also a speaker who has spoken at SQL Saturdays as well as the SQL PASS Summit, and as I write these interview questions was on his way to speak at the SQL PASS Business Analytics conference in 2013. I also liked quite a few of the pictures in his photostream here (http://www.flickr.com/photos/58251371@N06/), particularly because I tried the bean bag juggling, though I cannot find the picture anymore.

    I have never met Doug personally (so as such have never mistaken him for anyone else), and am only acquainted with him through Thomas LaRock's Rockstar Blogger list, so I am looking forward to finding out more about him from the questions in my interview.

    He also once won a SQL Cruise from Idera with this YouTube video:

    ------------------------------------------

    1. There was a point in time when you didn't have a blog, didn't tweet, and probably had no public presence whatsoever. And then, one day, you made the decision to put yourself out there. What prompted you to write that first blog entry that got you started?

    I had a personal blog about 6-7 years ago but I struggled with it. I did two posts: one about music I listen to while running, and one about a camping trip I took. It was horrible and nobody read it. I'm hoping the internet found a way to bury it alongside my MySpace page.

    Then, in late 2010, two things really pushed me to get back into blogging: Brent Ozar's blog and Steve Jones' presentation, "The Modern Resume". Steve convinced me that having a blog was important, and Brent convinced me I was capable of doing it. I'm immensely grateful for their influence. There's no way I'd be writing today without it.

    2. We all have influencers that affect our trajectory as a writer. It may be a teacher who told you that you had great potential, or another writer who impressed you that you wanted to be like? Or perhaps on the other end of the spectrum it was a teacher who told you that you were too stupid to write well enough to spell your own name, much less have people one day impressed with your writing? Who were your influences that stand out as essential parts of your journey to the level of writer you have become?

    I've heard stories from friends about how they had teachers that told them they weren't cut out for writing, science, athletics, music, and so on. It makes me enormously grateful to have never had a teacher like that. I had some uninspiring teachers, sure, but never one that told me I was destined to fail at something. In fact, several of my English teachers encouraged me to write. There's one in particular I'll never forget. Diana Daniels was my 7th and 8th grade English teacher. For one assignment, she gave me a note that said this:


    I still have it. I've gradually thinned out the stuff I kept from school but that one always makes the cut. I still feel good when I read it, even though it's from 25 years ago. Sincere encouragement lasts a lifetime.

    I would have LOVED writing for Saturday Night Live, Mystery Science Theater 3000, or Archer. I even chose my college, The University of Iowa, based on the fact they offered screenwriting classes and had a heralded creative writing program. While a writing career for film or television didn't come to be, I'm a firm believer in things happening in the right time and place. I can still write blog posts, presentations, and the occasional ultra-low budget screenplay with a sense of humor.

    3. As the years pass, how has your writing changed? Do you feel like it is becoming a more natural process? Or perhaps you get more critical of your own writing to the point that it takes you longer?

    Like all writers do, I think I'm getting better with practice. I'm getting better with tempo and efficiency. I'm also getting better at expressing my personality through writing without it resembling a train of thought. I'm a little faster now than when I first started. I don't struggle as much with how I'm going to say something.

    On the other hand, I take more time now to make sure what I'm writing is technically correct. I feel like I need to be more accurate and informed on my subjects. When I first started, I thought, "If I miss this detail or that, it's okay." Now I try to make sure the minor details all check out too. As we all know, there's NOTHING worse than being wrong on the internet.

    4. Assume a time machine has been created, and you are allowed to go back in time to speak to a group of potential writers, in which you and I are in attendance. What would you tell "past us", and do you think that your advice would change where you and I are in our careers now? Like would you tell yourself that one day you would be sitting here for a rather long period of time answering interview questions and not getting paid for it, instead of doing something else?

    First, I'd make sure they were all in a room on the ground floor. Then I'd tell them that in 2013, all of the following will be vastly more famous than even the most popular blogger: a monotesticluar man who cheated like crazy in French bike races, a show about unclaimed storage units, an unfinished calendar from an ancient civilization, skinny jeans for men, and a singular picture of a cat who looks unhappy. Many writers will throw themselves out the windows in shock and despair.

    Once the glass shard-encrusted writers have been pulled from the shrubs outside the window (we're on the ground floor for a reason), I'd tell them the good news. I'd show them fivethirtyeight.com, lifehacker.com, deadspin.com, and of course some SQL Server-related blogs. I'd tell them there are huge audiences for the things you're interested in. Combine that with the means to self-publish and promote, and no one can prevent you from being a success.

    I'd also share the two thoughts really paralyzed me when I was first starting my blog:

    Paralyzing Thought #1: "Someone already wrote about this topic."

    Louise Hay put it brilliantly. Addressing a crowd at a convention, she said this: "You'll have all these speakers. We're all going to say the same thing, really. But we're going to do it in slightly different ways. And everybody wants to hear things differently. Just because I say something, some of you will get it, some of you will say 'What is that woman talking about?' But another teacher -- or three or six or twelve -- can say the same thing that I'm saying in different words. And you'll go, 'Oh, that's brilliant! Never heard that before.'"

    Whatever you're going to write about, someone's almost certainly already covered it. But they haven't written about it your way. People may not understand an idea until they hear you explain it in your words.

    Paralyzing Thought #2: "Nobody's reading this."

    That's true in the beginning. Unless you're already well known, very few people will be anticipating your first blog post because you have yet to demonstrate quality and consistency. Your blog is like a retail store. If what you have inside is interesting or useful to people, word will spread and more people will come. Be patient.

    It's scary putting yourself out there in printed permanence, I know. But nothing gets you past the fear of publishing faster than hitting the "Publish" button again and again. If you need ideas or motivation, pick up Problogger's 31 Days to a Build a Better Blog. You don't have to do all the exercises in 31 days. Just do one whenever you're stuck. (Let's pretend this e-book exists and I'm not violating the space-time continuum by recommending it.) Gradually, your content will get better and your audience will grow.

    I'd conclude by saying, "Don't stress over it. Nothing about your blog is as big a deal as you think it is."

    If I told Historical Me that he'd be interviewed about writing and it wasn't conducted from prison, I think he'd be excited.

    5. Do you have any assistance from an editor, either formally or informally. And in either case, do you like your set up do you sometimes wish you had it different?

    I don't have an editor, and I'm not really worried about having one until I start writing detailed technical posts. That day is still a ways off since I'm really enjoying the topics and level of complexity I'm covering now. I do like to bounce ideas off people, but I don't usually have finished posts proofread by someone else.

    A bad habit of mine is proofreading after I've published. (Don't get me wrong, I proofread beforehand too.) I think every post I've done in the last year or so, I went back and updated at least twice after it'd been published. George Lucas admires my inability to leave perfectly good work alone.

    6. Finally, beyond the "how" questions, now the big one that defines the interview series. Why do you do write?

    I write because I enjoy it and I want to make people's lives better, whether it's getting people unstuck from a technical problem or just making them chuckle. The work I do is immensely enjoyable. I want to share some of that joy. I don't care if I'm paid for it or not -- that doesn't enter into my thought process.

    Another reason I write is to establish myself as a resource people can come to when they need a problem solved. I'm not trying to come across as a technical expert (because I'm really not -- not by a long shot), but rather someone who's had to solve the same problems my readers are having. It's funny that 48% of my page views come from a post about connecting a MacBook to a projector. I had no idea that post would be so useful.

    While I don't set out to write life-altering material. I have a powerful story coming that I hope will re-orient people. I'm waiting for the right time to publish it -- probably early summer.

    Bonus Question: Are there any projects coming up that you would like to tell people about?

    One project I've had on the back burner for FAR too long: SQL Server Murder Mystery Hour. Like one of those murder mystery dinner parties, except done at a SQL Saturday or maybe one of the nights of PASS Summit. I've let this idea percolate for two years now (like I said, FAR too long). Here are a few ticklers:

    • Think Murder on the Orient Express, except it's a database or server that's killed. 
    • Attendees form teams to solve the crime.
    • Names of the suspects are a gag, e.g., Bill Freeley is a consultant.
    • Slightly over-the-top, Poirot-style interrogations will reveal clues.

    Okay, writing about it really has me excited to get moving on it again.

    ------------------------------------------

    Wow, this has been a fantastic read. Doug has given a lot of great and interesting answers to my questions. Some notes:

    • I too loved Steve Jones' presentation, "The Modern Resume". Chock full of fantastic information about how to enhance your career and behave yourself (Brent’s blog is great too :)
    • I have always wanted to be a sitcom writer too. I took some advice from the early Simpson’s writers. The goal is something that is funny over and over again, not just once. I know I still laugh at the Simpson’s after 15-20 viewings of many episodes.
    • The George Lucas comment about not leaving well enough alone is a problem I have too.
    • I feel a good bit of kinship with his “why” answers too (other than the MacBook thing, I considered editing Mac references out…)

    I am sad a bit that he didn’t hit on my answer to past me, but it will come one day. Like I have said before, when I get the same answer, I will interview myself…

    I love the idea for the murder mystery, and am hereby invited to SQL Saturday Nashville .Next to do the SQL Server Murder Mystery at least as a session, or perhaps some other time.. (you will still have to provide your own transportation :).

    Next up is Jason Strate (@stratesql), someone I have known for quite a long time (and have worked with several times), and am certainly looking forward to see what he comes up with. I have really enjoyed these interviews so far, and I hope you have too.

  • Why We Write #3 - An Interview With Rob Farley

    In the third entry in this series, we take a turn south, not in quality, but in the geography of our next entrant. Rather our interview target is Rob Farley, who is from (well lives in) Australia. 

    Rob Farley is a SQL Server MVP, and is quite a busy fellow. He is the owner of a consulting company named LobsterPot Solutions, located in Adelaide, and is a current member of the PASS Board of Directors. His blog is located at SQL Blog, where I also blog, and he tweets under the extremely unobvious handle of @rob_farley. He speaks regularly at SQL PASS conference, and sang during the keynote with the one and only Buck Woody (http://blog.datainspirations.com/2011/10/14/pass-summit-2011-day-3-keynote/).

    Rob has been a friend for quite a few years now, starting (in my mind) when I introduced myself to him at a conference thinking he was Arnie Rowland (yet another wonderful member of the SQL community, whom you might mistake for Rob from a hard working standpoint, but Arnie doesn't wear glasses regularly :). As I remember the story, neither were offended, much like when people mistake me for Orson Welles, I am honored because he was such a great writer. I will note too that Rob remembered it differently, but my version makes me sound far more intelligent. Rob is a tough one too, as I once worked with him on a Microsoft Learning contract in Seattle where he had recently had his appendix out (remember where he is from… and I get kind of sore from a 4 hour flight!)

    So, now that we have gotten past the silliest parts of the interview from my contributions, on to the interview questions.

    ------------------------------------------

    1. Think back to the moment you hit the first key, starting to write a blog, an article, a book, or whatever. What made you do it? Or perhaps, what were you expecting to achieve that was better than your previous use of free time. Have you gotten the benefit you were shooting for back then?

    It was April 2005. I had been getting more and more involved in the community, attending the occasional user group, both .Net and SQL Server, and there was an all-afternoon event about SQL Server 2005 that I went along to. I’d already been thinking about getting into blogging, and a conversation with one of the evangelists from Microsoft who was at this event meant that I wrote my first blog post the next day. At the time, I just figured that it might be helpful for someone, but didn’t know who that might be. At the time, I was feeling like I needed to be stretched, and blogging gave me the chance to write about the things that I knew, and to go a little further with things than I had before. When you write things down, you find yourself wanting to make sure that it’s right – blogging gave me that then, and still does. Unfortunately, I cringe at old blog posts, as I think we all do [ed; I know I certainly do!], but I still enjoy the experience of getting content into a blog-worthy condition and publishing it for other people to read.

    2. We all have influencers that have advanced our careers as writers. It may be a teacher who told you that you had great potential? Another writer who impressed you that you wanted to be like? Or perhaps on the other end of the spectrum it was a teacher who told you that you were too stupid to write well enough to spell your own name, much less have people one day impressed with your writing? Who were your influences that stand out as essential parts of your journey to the level of writer you have become?

    In school I had teachers that liked my writing, and teachers that thought it was awful. From that, I managed to discover that my writing had a particular style, a ‘voice’ (accent?) that could be heard. Today I value that in my writing, and try not to let it go. The times I’ve written book chapters I’ve worried a lot about losing that style, as editors often try to avoid having that kind of thing come through. It’s probably like how I’ve a tendency to use contractions. If I couldn’t’ve ever used them, I think I’d’ve struggled to write much, as people wouldn’t hear me in what I wrote. Perhaps JD Salinger had an effect on me, as Holden Caulfield’s voice came through so much in that book.

    3. Can you describe the process you go through to write (including any tools you find indispensable), from inception of an idea until it gets put out for consumption?

    This depends on what kind of thing I’m writing. :)

    I’m very big on just opening Live Writer and pouring text onto the screen. Of course I’ll need to spend time in SSMS, getting the queries right to demonstrate the technical aspects, but I like to just get the text flowing. I’m very self-critical, which means that I don’t try to think how to phrase every sentence, or use just the right simile, but rather, I try to bring the reader into what I’m writing and explain things to them. I’m currently trying to get online training sorted which I call “Train-the-Explainer”, because I want to be able to teach people things in a way that helps them really understand the concepts of what’s going on, and I try to have that same idea come out in my writing. I’m likely to end up using phrases like “You know how…, well it’s like that,” in my writing, but when it comes down to it, I want people to read it as if I’m sitting next to them, explaining things to them.

    What I find really hard is writing songs or jokes. I realise that I tell jokes, even during presentations, and I wrote a comedy set for the PASS Summit in 2010 and a song for 2011, but as much as I’d like to do much more of that, I really struggle. I really want to write both, but find myself crossing things out, or finding that things really aren’t as funny (or poignant or whatever) as I’d like. A co-writer would be good – someone I could bounce things off so that they can tell me when an idea is worth pursuing, and when my ranting should be converted into an actual joke.

    4. Assume a time machine has been created, and you are scheduled to speak to a group of potential writers, in which you and I are in attendance. Without concern for the temporal physics that might cause the universe to implode making the answer moot, what would you tell "past us", and do you think that your advice would change where you and I are in our careers now? (like would you tell yourself to get excited for the day you will be sitting here for a rather long period of time answering interview questions and not getting paid for it, instead of feeling the warm sun on your forehead?)

    Don’t get me started on the time travel thing. I have conversations with my kids about that kind of thing, like ideas around how paradoxes could get resolved… but back to the question!

    If I could choose when to go back to, I’d go back much further… to a time when I thought I wasn’t any good at writing (ok, that’s typically still the case – did I mention I’m self-deprecating?), and was choosing to pursue a computer-focused degree. I’d tell myself to really explore the things that I enjoyed, including writing, and to just get started. I could put so many things in that bracket – comedy, writing and music are some that I’ve already mentioned – but I keep finding myself way more interested in people than in technology. I enjoy teaching (adults, not kids), I enjoy ministry, I enjoy community, but my career has largely been focused on technology. I’d tell those potential writers to start doing those things which define them. Solving puzzles can be fun, but unless those puzzles are allowing you to be creative, then they may not be completely satisfying. Of course, I doubt it would make a difference. Someone who’s good at maths will see the creativity in that and still end up in IT.

    5.Finally, beyond the "how" questions, now the big on. There are no doubt tremendous pulls on your time. Why do you do write?

    This comes down to that last question. I write because it’s something which lets me be slightly closer to what I want to spend my time on. I’d like to be completely financially independent, and be able to spend my days helping other people with things. My career as a consultant lets me do some of that, but not in the way that I really want. Those people who ask me for help with things probably know that I quite willingly invest myself into their particular problem, and I honestly do it completely for them, because I enjoy it. Writing lets me do that in a way that means they don’t have to ask – for those people that go looking for something and stumble across it.

    Finally, a bonus question I provide to let the person stretch the topic and talk about anything they want to:

    1. Is there any project you would like to tell people about that we haven't yet mentioned?

    I should be better at marketing, but I’m really bad at it. I should write some stuff about how LobsterPot is a great company that you should all use to improve your data story. We can help you write better T-SQL, tune your system, get your data into a data warehouse, even present it in the amazing PivotViewer platform that we ported to HTML5 so that it runs on iPads. I should write about the Train-the-Explainer thing that I want to do, where I’ll charge people a small amount to attend an online classroom (limited sizes) to have me explain SQL stuff to them in a way that hopefully means that they can not only implement the ideas, but can actually explain it to other people. I should write about how I’m available to teach Advanced T-SQL courses, and will happily come to just about anywhere in the world to do so (although it’ll be at your expense, and it’ll have to fit into my course schedule). But I’m not good at self-promotion, so if your readers want to ask me about these things, they should probably just drop me a line and start a conversation.

    …I’m always happy to talk. [ed. @rob_farley is his twitter if all else fails]

    -------------------------------------------------------

    I definitely want to thank Rob Farley for taking the time to answer my interview today. I got a bit more insight into how yet a third person thinks about the process and value of the writing process. His why answer reminds me of some of the reason I got started answering forum posts. I don’t always love helping individuals directly because usually when you have gone out and asked a question, you are lost and just need that straightforward how do I get out of this jam, answers. Kind of like when you go to the gas (petrol?) station and ask for directions. If they start telling you how you should have planned ahead, while it is good advice, it can tick you off. The only person who is apt to learn a lesson there is a bystander who hears the answer. Since they aren’t lost, hearing how to ever avoid being lost may be useful. When writing. I always try to help with the immediate need first: “the bakery is a block that way”, and then “the app you have on that phone I see will tell you how to get there if you are ever lost again”. They might not care, but the next reader might.

    Still not the answer I would give to the time machine question (other than the paradox stuff!), but I love Rob’s answer.

    The next entry will be Doug Lane, who works in BI. He will be speaking at the PASS BA Conference this week (4/10-12, 2013; so don’t go there if this is 2020 when you are reading this and blame me), so feel free to suggest answers for him if you see him there!

  • Why We Write #2 - An Interview With Mark Vaillancourt

    My second guest is Mark Vaillancourt (whose last name makes me very happy for the copy and paste feature), who is an Information Management consultant working for Digineer, and is a Regional Mentor for PASS in Canada. Mark is also a speaker at SQL Saturday events, as well as the SQL PASS Business Analytics conference in 2013.

    Mark has been blogging regularly since early 2009 on his website (http://markvsql.com/), and interestingly, has degrees in English and Theater, two degrees that almost always lead one into a career in technology.  His twitter account, @markvsql, is also quite active with over 6400 tweets to date. To be honest, I don't enter into this interview knowing nearly as much about Mark Vaillancourt as I did about Thomas LaRock in entry #1, as Mark is more involved in Business Intelligence while I spend most of my conference and blogging time in the OLTP/Relational Engine side of things. I am looking forward to learning more about his writing process and his career in his answers to the following five questions.

    Mark is currently working on his first white paper to be published via Digineer’s website. He wouldn’t reveal the topic, but describes it as a topic that he feels is under-served and will help a lot of people. I hope he will give me the link to include in this interview when he gets it finished.

    -------------------------------------------

    1.  Every superhero has an origin story, and in many cases it wasn't because they specifically were planning to go into the field of superhero-ness. I mean, clearly Peter Parker didn't really want to get bitten by a radioactive spider. So what is your story that led you to spend part of your free time writing about SQL?

    In my early days at Digineer, Lara Rubbelke, who actually hired me during her tenure there, encouraged me to blog about my experiences learning SQL Server. Since I was hired there having never worked with SQL Server before, there were sure to be many learning opportunities. Whenever we would talk about the obstacles I was encountering and what I was doing to overcome them, she would always end the conversation with, “Blog about it.” I finally took her advice and got a blog connected to the old Digineer website. It was some time later that I ended up heading out on my own for my blog, including getting my own domain, with a lot of great advice from Jason Strate. Jason pointed me to, among other things, Brent Ozar’s series about blogging. That was really helpful in getting going. (Editor note: here is a link to his advice on his blog a few years back http://www.brentozar.com/archive/2008/12/how-start-blog/)

    2. We all have influencers that have advanced our careers as writers. It may be a teacher who told you that you had great potential? Another writer who impressed you that you wanted to be like? Or perhaps on the other end of the spectrum it was a teacher who told you that you were too stupid to write well enough to spell your own name, much less have people one day impressed with your writing? Who were your influences that stand out as essential parts of your journey to the level of writer you have become? 

    I had a teacher in high school for English, and also for Creative Writing, named Richard White. He taught me the power of verbs, the importance of dialog, and reinforced the old writing axiom, “Show; don’t tell.” While these three lessons were aimed at fiction, I try to keep them in mind in my technical writing, as well. I try to make my writing sound like I am just speaking. To me, in essence, a blog post is a presentation I only have to give once; a presentation that keeps on presenting, if you will.

    I have also been fortunate enough to have an unofficial blogging mentor: Jason Strate. While he was working to take his own blogging to the next level, he was constantly sharing lessons learned with me. Whether it be a new tool he had tried or just even a bit of blogging philosophy, he set a great example. Many thanks to Jason.

    3.  Can you describe the process you go through to write (including any tools you find indispensable), from inception of an idea until it gets put out for consumption? 

    As far as tools go, Snag-It is the best thing ever. I love that application, and not just because my laptop lacks a “Prt Scn” key. It is so easy to capture screen shots of just about anything and apply highlighting, arrows, shapes, just about anything. I rely on it heavily for images I use in my posts, and sometimes presentations as well.

    Although it is not really a tool, I have to say the Flickr is an AWESOME place to get images for blogs and presentations. Jason Strate showed me that one several years ago. Just filter your search for Creative Commons content and provide links to the source for the images you use and you are off to the races. I have found so many great images out there.

    As far as process, I don’t know that I have one. But I think I can nail down some actions that I tend to take during the creation of many of my posts.

    • Find/Create a fun dataset.

      • The people that created the AdventureWorks database worked very hard to do so and provided examples of a lot of different things in the process. They deserve our gratitude. However, I try very hard to avoid having my blog posts and presentations be about selling bikes and accessories. If you look over my posts, you will see data examples relating to Super Heroes, The Smurfs, Romeo and Juliet… Keeping the datasets fun is part of what makes it fun for me.
    • If I am demonstrating how to perform some set of actions, I make sure to number the steps as well as the Figures (screenshots, etc) used. Then, I truly document every step along with the expected outcome of each. That takes time. And I am OK with that. When one considers how long a blog post will be “out there” after it is posted, taking the time to make it solid and clear is well worth it. It drives me nuts when documentation skips some steps in the middle of a process while assuming you just “know” to do them.
    • When screenshots are not appropriate to the topic, I make sure to find some fun pictures from Flickr to use. I make sure to choose images that are loosely related in some way to what I am writing about, but a bit entertaining as well. A picture of Devil’s Tower makes perfect sense in a post about ones experiences at a SQL Saturday in Chicago. And a 1960s era Ladies restroom sign is the ultimate homage to the Women in Technology Luncheon at the PASS Summit.

    4. Assume a time machine has been created, and you are allowed to go back in time to speak to a group of potential writers, in which you and I are in attendance. What would you tell "past us", and do you think that your advice would change where you and I are in our careers now? <like would you tell yourself that one day you would be sitting here for a rather long period of time answering interview questions and not getting paid for it, instead of…?>

    The best advice I could give “past us” is the same advice I give people who tell me they want to blog but are apprehensive.

    • Don’t be afraid to blog because you feel you don’t know enough. If everyone waited until they knew everything before blogging or presenting, we would have ZERO bloggers and presenters. Blog now; learn while you do it.
    • Don’t be afraid to blog about topics that others have already covered. People learn in different ways. While the topic may be the same, YOUR way of explaining may be exactly what someone needs for that AHA moment that has been eluding them.
    • Don’t be afraid of making a factually incorrect statement and getting called out on it. Mistakes happen. Do your best to verify what you are writing (you will learn a lot during this activity) and you will be fine. If you think a particular statement is true, but are unsure, say so and indicate why. Be honest about what you are writing and people will respect that.

    5. Finally, beyond the "how" questions, now the big one. There are no doubt tremendous pulls on your time. Why do you do write?

    I have a few different answers to this one.

    Before joining Digineer, I worked in general IT. Our department had a purple binder entitled, “Learned the Hard Way – or I don’t EVER want to have to figure this out again.” In that binder we placed really obscure problems we encountered along with their solutions. These were issues that happened so infrequently that remembering the details between occurrences was just not going to happen. Sometime I use my blog as my purple binder.

    I went to college with the intention of becoming a high school English Teacher. I got as far as student-teaching in a local middle school and even substituted a few times. When I discovered Theater, I ended up putting my main focus into acting. Even so, I am still a teacher at heart and LOVE sharing knowledge with other people. Blogging and presenting are an extension of teaching, as far as I am concerned.

    There is a poem commonly attributed to Ralph Waldo Emerson (although there is a bit of controversy about that) that really sums up why I do most things. I have loved this poem since high school and try to keep true to its meaning.

    Success 

    To laugh often and much; 
    to win the respect of intelligent people  
       and the affection of children; 
    to earn the appreciation of honest critics  
       and endure the betrayal of false friends; 
    to appreciate beauty; to find the best in others; 
    to leave the world a bit better, 
       whether by a healthy child, 
       a garden patch 
       or a redeemed social condition; 
    to know even one life has breathed easier 
       because you have lived. 
    This is to have succeeded.

    Blogging is one of the ways that I work toward achieving Success.

    -------------------------------------------

    Wow, that was quite an interview, chocked full of good advice, and something most blogs about technical writing will not have…controversially attributed poetry. Some of my favorite bits include noting that blogging/writing is a great way to learn, and you don’t need to be perfect to start. I find that the research I do to try to avoid being wrong makes working hours on a seemingly simple topic often well worth it when I am working during the day (during the getting paid part of the day!). And you don’t have to be perfect, as long as you try to get it right, are somewhat interesting and provide something for readers to learn (and remember, there are many levels of readers out there). When you are wrong, a reader or two will tell you… I promise. (Thick skin is very helpful for public writing!)

    So far, my biggest surprise has been that I haven’t gotten a particular answer to the time machine question. Stay tuned, someone soon is bound to answer what I have expected (and then I will add a supplementary entry to admit to the answers to the questions I would give myself!)

    To the focus of the series, I now have three reasons why my first two interviewees write:

    1. Because there are words that have to be written

    2. Keep up with stuff I know

    3. Working towards success

    The second answer is definitely high on my list, but it certainly isn’t quite enough to keep me typing on this keyboard week in and week out in my free time (when minimally I could be building something with my Legos and preserving the springiness of the keys on my keyboard.)  So the quest continues, with my next subject Rob Farley, who will hopefully get us one step closer to the answer to the question of why we write.

  • Why We Write #1 - An Interview With Thomas LaRock

    I 've been a writer of trade level technical materials for over 13 years now, writing books, articles, blogs, and even tweets for a variety of outlets, almost exclusively about Microsoft SQL Server. While I won't claim to be the best writer in the world, I feel like I have the process of writing down fairly well, yet, for the life of me, there is still the question of "why do I do this?" stuck in the back of my mind that I have yet to appease.

    Note that my quest specifically deals with non-verbal communication, because it seems to me that presentations are a completely different sort of "why" altogether.

    So I have decided to survey as many of my technical writing colleagues and find out their answer to the "why" question. The only criteria for being included in this set is that you write about a subject like programming, gadgets, computer administration, etc.; and that you don't make your most of your living from writing (in other words, if you stopped writing today, tomorrow you would not be in fear of sleeping in the gutter.) 

    To get the process started, I have asked Thomas LaRock to be my first survey participant. Tom is a SQL Server MVP, has written a very popular book called DBA Survivor for Apress, frequently tweets as @sqlrockstar, and blogs at www.thomaslarock.com where he maintains a popular ranked list of SQL bloggers (of which I am listed in the tempdb category).  He is a member of the executive committee of SQL PASS, and is very active in the SQL community as a speaker. He currently works for  Confio as a Technical Evangelist. Tom is also quite well known in our SQL communitiy as a lover of the delightful cured porcine meat known as bacon.

    If you want to see Tom in person, he will be doing a pre-conference seminar with Grant Fritchey and Dandy Weyn this year at Tech-Ed North America in early June in New Orleans entitled How to Be a Successful DBA in the Changing World of Cloud and On-Premise Data.

    -------------------------------------

      1. Every good superhero (or in your case, SQL Rockstar) has an origin story. What got you involved in writing?

      Tom: The birth of my daughter. I wanted to record as many details as possible and since I had 10MB of available space for a website as part of my cable package (yeah...10 MEGABYTES BABY!) it was easy enough to get a website up quickly and easily. The writing came easily, too, since I was writing about something so close to my heart, something I remain passionate about to this day.

          2. We all have influencers that have advanced our careers as writers. It may be a teacher who told you that you had great potential? Another writer who impressed you that you wanted to be like? Or perhaps on the other end of the spectrum it was a teacher who told you that you were too stupid to write well enough to spell your own name, much less have people one day impressed with your writing? Who were your influences that stand out as essential parts of your journey to the level of writer you have become? 

          Tom: I never try to be exactly like someone else. If I did then I would always be second best. Instead I've learned to take bits and pieces of different people and shape them into who I am today. The writer I admire most these days is Bill Simmons followed by Gregg Easterbrook. Both are known more for their sports writing but their style of writing is one that I try my best to emulate: it's human. I do not enjoy the dryness of technical writing, I prefer to write from my heart about things that I enjoy. That makes it less of a chore.

            3. My writing process is pretty drawn out, often starting on my phone in OneNote, sometimes finishing in 10 minutes, but often taking a year (or years) to finish an idea. Can you describe the process you go through to write, from inception of an idea until it gets put out for consumption? 

            Tom: I used to start a draft inside of WordPress but lately I have been using EverNote to track my ideas and take notes. From there I just decide to go and get it done. I do my best to follow a very loose format: describe a problem, explain why it's an issue, help readers understand any and all tradeoff (cost, benefits, risks), and a few action items for them to use as a take away. Once I have that framework in my head it doesn't take long to get to a finished product. I think I may spend more time on finding a decent image to use with my post than the actual writing itself.

              4. Assume a time machine has been created, and you are allowed to go back in time to speak to a group of potential writers, in which you and I are in attendance. What would you tell "past us", and do you think that your advice would change where you and I are in our careers now? 

              Tom: Write for yourself first. Feed your own soul. Don't worry about what your readers want. You can't write for others, they will never be happy with what you have done. The only person that needs to be happy with your words is you. When you write and share yourself then your readership will grow with people who are naturally drawn to you, and it makes it easier for you to keep sharing your words with people that want to hear them. And no, this advice wouldn't change. Ever.

                5. Finally, beyond the "how" questions, now the big one. There are only 24 hours in a day, and there are no doubt tremendous pulls on your time from family, friends, and pork products, yet, even considering just your blog output, you obviously sit down at a keyboard very often to write. Why?

                Tom: Most of the time I just feel that I have words that need to be written. Doing so helps to feed my soul. I'm at a keyboard a lot because my job requires it, and I am able to spend a lot of my day just writing as a way to communicate with others. Sometimes it's an email, sometimes it's a support ticket, other times it's a blog post.

                -------------------------------------

                I want to thank Tom for being my first participant in my experiment. I find his answer to the “why” question very similar to mine, in that he doesn’t so much offer a tangible reason, but more that he feels compelled to do so. I have to say that the question of how he got started is really quite unexpected, and very interesting, and is going to affect my future questions I ask because more than just the origin story, it will be interesting to see whether people started writing technically first, or for some other reason. I know that before I wrote my first book, I had never written 2 pages of material that wasn’t graded rather harshly by someone with PhD behind their name (or at least one of their low paid minions.)

                Unfortunately (or fortunately if you enjoyed this first entry) Tom certainly did not resolve any of my questions to any level of satisfaction so I am going to have to continue to ask more of my technical writer colleagues for their opinion as well.

                To that end, my next interviewee will be Mark Vaillancourt, whose website is http://markvsql.com/ and whom has a degree in English and Theatre (so he will know if it should have been whom or who earlier in this probably run on sentence), so that could make for quite an interesting interview. Perhaps he may resolve my curiosity about how one can go from the seemingly non-technical to spending his time working on SQL Server Business Intelligence. I don’t know but I look forward to finding out.

              1. My New Year's Goals 2013

                So, I have completely given up on my new year starting on Jan 1 where blogging/writing/community is concerned. I love the holidays WAY too much, and I love football (of the American variety with the oblong ball, of course) WAY too much, and so, that is why this year I waited until after the Super Bowl to get to this point (this was supposed to be posted last week, but #1 on the list got in the way!).

                Last year, I promised to do some things in my resolutions, and because I failed on one (1. get the book finished quickly…it took forever due to unforeseen circumstances), and overly succeeded (time wise) on another (4. I did two pre-cons last year), and both of these took a lot out of me! This year, no book riding my back (yet), but I do have several projects on the way that I will announce later in a more grand way (very exciting stuff to me for sure).

                This year, my goal is to get my community involvement right! I love the community, but sometimes I feel like it is crushing me. I don't want to be one of those people who quit the community, because I do love it and with my daughter grown up now, I have a lot of time to work on it. I enjoy the community so much, and I consider the PASS Summit part of my holiday season, and the people at the Summit a bit like family. So my goals for the year are to keep involved, but to make sure it is reasonable. So I present my 10 things goals for this next year.

                   

                  1. Get healthy. Since I started this blog entry, I had a very minor (yet extremely painful) health issue that was a wake up call (hint, minimally I have to drink a lot more water!) I have spend far too much time writing and speaking (and worrying about writing and speaking) and not enough time working on what matters (and sleeping, need more sleeping too!)  I don't want to miss these two growing up and if I have to drop out of the community to make that happen, I will.
                  2. Do stuff that I want to do, the way I want to do it, (but better). While I have always wanted to be an entertaining and educational speaker (Tom LaRock and Karen Lopez are great examples of this kind of presenting,) my actual presenting style is far different…more straightforward teaching, heavily scripted and heavily practiced. When I get it right, it works, but I constantly try to do far too much in the time allotted, and my nerves can get the better of me when I go off script. (I used to say "as a speaker, I am a good writer," and this is why. As a writer, I can edit myself multiple times!)
                  3. Get in a writing rhythm. Last year, I finally got my What Counts for a DBA series flowing, and this year I am adding a series on SQL Server metadata to the mix to my Simple-Talk blog. I will also try to put up a few blogs about other SQL Server/Design/Professional Development stuff here on SQLBLog too. All of this is leading up to more books in the future…so getting back into a rhythm and trying out new material is very important to the process of writing books for me.
                  4. Stay working in the MSDN forums. I have recently gotten back and active in the Database Design Forum and I plan to keep up answering at least all of the questions I can in that forum and perhaps others.
                  5. Always put in Database Design sessions when I submit to speak. It is what I really love to talk about, and even the SQL Server metadata series is based somewhat on the idea of being able to figure out a design that has been implemented.
                  6. Get a good development session written/practiced. Last year I wrote a session on sequences that I think was pretty good (worst feedback was that I tried to do way too much!) but really didn't resonate with anyone yet. I also did a trigger session at PASS that I have heard was good content, but needs some organization. I am reworking that one into a session I am going to call "How to Write a DML Trigger" (in slight homage to the series of Goofy shorts where you are taught how to do something, but with less dog carnage), that will start at the beginning and work to the existence of a trigger that does some realistic task.
                  7. Speak online more. Speaking online is actually quite comforting for some reason to me. I don't like not being able to get crowd feedback, but at the same time, not expecting feedback keeps that one frown (or two or twenty) from getting in my head and keeps me on my practiced script. I am going to finally start hosting my own practice sessions sometime this year as well. So before I debut a session, I am going to do an online practice session; and before a big conference (SQL PASS or Devlink are my two typical examples) I am going to review the material on my own livemeeting connection with an hour or two warning via twitter.
                  8. Actually blog about devices. Yeah, I love devices and I am contemplating my first tablet purchase this year. I really need to talk about them more than just in tweets, as devices/gadgets are what allow me to have the lifestyle I have as a highly mobile telecommuter.
                  9. Volunteer with PASS in some capacity. I feel like I need to do more for the community than I have been, as such, I am going to volunteer for one or two committees. Last year I volunteered for the selection committee, and was the #1 vote getter who lost :). I may try again, and I have volunteered for another committee too. If I don't get in either one, so be it. I do have plenty to do, but I want to get a bit more involved, perhaps to some day run for the board again, once I feel like I am ready.
                  10. Something I am not yet ready to announce. (and if you are my employer, I am not leaving you, relax :)) But it is something exciting to me, and hopefully you too.

                Most of all, on average, have fun doing what I am doing. This is my hobby, and not currently my career. If I stopped blogging/writing/speaking my life would not change tremendously except that my Lego collection wouldn't stare at me longingly as I walk to my writing chair. At the same time, I would truly miss sitting here at my TableMate II destroying the keyboard on yet another laptop, and even more I would miss the people and experience of all of the conferences I get to attend.

                WP_20130217_002

                I won't lie, often this keyboard is a drag to look at, but just as often it is a true joy. As long as I feel like the focus of Pete Townshend's Guitar and Pen:

                  "When you take up a pencil and sharpen it up
                  When you're kicking the fence and still nothing will budge
                  When the words are immobile until you sit down
                  Never feel they're worth keeping, they're not easily found
                  Then you know in some strange, unexplainable way
                  You must really have something
                  Jumping, thumping, fighting, hiding away
                  Important to say"

                I am going to keep writing and speaking… I really just have to.

              2. One more reason to to understand query plans, not directly performance related

                One of the things that separates a good programmer from a great one is a firm understanding about what is going on inside the computer. For some programming languages, it is very obvious what is going on inside the computer because you are working at a very low level. For example, if you are a C/C++ programmer writing an OS, you will know a lot about the hardware as you will interact with it directly. As a .NET programmer you are more encapsulated from the hardware experience, making use of the .NET framework.

                None of the aforementioned programming languages comes anywhere close to the level of encapsulation that we SQL programmers work with.  When you execute a statement like:

                SELECT *
                FROM    Tablename

                A firestorm of code is executed to optimize your query, find the data on disk, fetch that data, format it for presentation, and then send it to the client. And this is the super dumbed down version.  SQL is a declarative language, where basically we format a question or task for the system to execute without telling it how.  It is my favorite type of language because all of the pushing bits around get tedious.  However, what is important for the professional SQL programmer is to have some understanding of what is going under the covers, understanding query plans, disk IO, CPU, etc. Not necessarily to the depth that Glenn Alan Berry (http://sqlserverperformance.wordpress.com/) does, but certainly a working knowledge.

                Performance is the obvious reason, since it is clearly valuable to be able to optimize a query, but sometimes it can come in handy to debug an issue you are having with a query. Today, I ran across an optimizer condition that, while perfectly understandable in functional terms, would have driven me closer to nuts if I hadn’t been able to read a query plan. The problem came in based on the number of rows returned, either it worked perfectly or it failed with an overflow condition. Each query seemingly touches the exact same rows in the table where the overflow data exists…or did it.

                The setup. The real query that the problem was discovered in was our data warehouse, and was a star schema configuration with 20+ joins. In the reproduction, I will use a simple table of numbers to serve as the primary table of the query.

                create table ExampleTable  -- It really doesn’t matter what this table has. The datevalue column will be used to
                                           -- join to the date table, that I will load from the
                (                          -- from the values I put in this table to make sure all data does exist
                    i int constraint PKExampleTable primary key,
                    dateValue date
                )

                ;with digits (i) as( --(The code for this comes from my snippet page: http://www.drsql.org/Pages/Snippets.aspx).
                                    select 1 as i union all select 2 as i union all select 3 union all 
                                    select 4 union all select 5 union all select 6 union all select 7 union all
                                    select 8 union all select 9 union all select 0)
                ,sequence (i) as ( 
                                    select D1.i + (10*D2.i) + (100*D3.i) + (1000*D4.i) + (10000*D5.i) + (100000*D6.i) 
                                    from digits as D1, digits AS D2, digits AS D3 ,digits AS D4, digits as D5, digits As D6
                )
                insert into ExampleTable(i, dateValue)
                select i, dateadd(day, i % 10,getdate()) -- Puts in 10 different date values
                from sequence
                where i > 0 and i < 1000
                order by i

                Next I will load the date table with all of the distinct dateValue values that we loaded into the ExampleTable, plus one, which is the max date value for the datatype. In the “real” world case, this is one of our surrogate null values we use to indicate that it is the end date. (Yes, we are ignoring the Y10K problem.)

                create table date
                (
                    datevalue date constraint PKDate primary key
                )

                insert into date
                select distinct dateValue
                from   ExampleTable
                union all
                select '99991231'
                go

                In the typical usage, the number of rows is quite small.  In our queries, we are adding 1 to the dateValue to establish a range of a day (in the real query it was actually a month). Executing the following query that returns 99 rows is successful:

                select *, dateadd(day,1,date.dateValue)
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue
                where  i < 100

                However, remove the where clause (causing the query to return 999 rows):

                select *, dateadd(day,1,date.dateValue)
                from   ExampleTable
                          join date
                             on date.dateValue = ExampleTable.dateValue

                And you will see that this results in an overflow condition...

                Msg 517, Level 16, State 3, Line 2
                Adding a value to a 'date' column caused an overflow.

                Hmmm, this could be one of those days where I don’t get a lot of sleep :).  Next up, I check the max date value that can be returned.

                --show that the top value that could be returned is < maxdate
                select max(date.dateValue)
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue

                At this point, I start feeling like I am going nuts. The value returned is 2013-01-30. So no data is actually returned that should be too large for our date column… So then I think, well, let's add one to that value and take the max:

                select max(date.dateValue), max(dateadd(day,1,date.dateValue))
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue

                This returns, mockingly:

                Msg 517, Level 16, State 3, Line 2
                Adding a value to a 'date' column caused an overflow.

                So, since it worked with fewer rows earlier. I decide to try lowering the number of rows again, this time using a derived table, and it DOESN’T error out, even though it is obvious (because I stacked the deck…data) that the same data is just repeated for the dateValue, particularly since we get the same max dateValue as we did earlier.

                select max(date.dateValue), max(dateadd(day,1,date.dateValue))
                from   (select top 100 * from ExampleTable order by i) as ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue
                 
                       
                Well, you are possibly thinking, this just doesn't make sense. It is how I felt too after trying to do the logic in my head. I will admit that I didn’t know about query plans I would have been completely lost. But alas, the answer was fairly easily located in the plan. Taking a look at the plan for the query version that returns 99 rows:

                select *, dateadd(day,1,date.dateValue)
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue
                where  i <= 100

                We get the following estimated plan:

                image

                In this plan, it uses a nested loops operator, which basically will do 100 seeks from the top input (the ExampleTable), for each row fetching the date value, and then calculating the scalar value (dateadd(day,1,date.dateValue) ) on the values that match in the plan. Since the 9999-12-31 date is never used, there is no overflow.

                However, when the number of rows in the when the size of the output reaches a certain tolerance (in this case 999 instead of 99) from the following query:

                select *, dateadd(day,1,date.dateValue)
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue

                We get a different plan, one that is causing us issues:

                image

                Instead of nested loops, it uses a Hash Match Join, which takes the entirety of the smaller table and builds an internal hash index (basically setting up buckets that can be scanned much faster than an entire table…in our case, probably just a single bucket), and then scan the other set checking to see if the row exists in the hash index.

                It is in the process of building the hash index that our query runs into trouble. Since the date table is so much smaller, it plans to build the hash index on that table, and pre-creates the scalar values as it is doing the scan, since there are 11 rows in the date table, rather than having to calculate the value 999 times if it did it after the join. When it adds a day to the 9999-12-31 date, it fails.

                I know, the question of how practical is this scenario is bound to arise. I won’t lie to you and suggest that it is likely to happen to you as it it did to me. However, the point of this blog isn’t that this one scenario is bound to happen to you, but rather that understanding how SQL Server executes queries will help to give you insight to fix problems with your system, mostly performance, but sometimes every esoteric issues that won't just leap out as being based on the query plan that was chosen. (For more reading on query plans, check out Grant Fritchey’s Simple-Talk book on query plans: http://www.amazon.com/Server-Execution-Plans-Grant-Fritchey/dp/1906434026).

                In the end, the fix to my problem was simple. Make sure that the value that has meaning in the table, but not in the query, was filtered out:

                select *, dateadd(day,1,date.dateValue)
                from   ExampleTable
                         join date
                            on date.dateValue = ExampleTable.dateValue
                               and date.dateValue < '9999-12-31'

                Note: a commenter noted that in some cases, excluding the offensive data using the ON criteria/WHERE clause may not solve the issue. This is very true, and really will be made evident in the plan. I would expect it to be more likely to be definitely excluded in the JOIN clause, but you really can't guarantee anything that the optimizer might do without changing the source data (or representing the source data using a derived table as):

                select *, dateadd(day,1,date.dateValue)
                from ExampleTable
                       join (select * from date where date.dateValue < '9999-12-31') as date
                            on date.dateValue = ExampleTable.dateValue      
                             

                Looking at the different variances to the plan you should be able to diagnose a "hidden" problem such as I have described by finding the flow of data and making sure that the filtering operation happens before the calculating of the scalar that causes the overflow error. This may harm performance in my query for even the more "ideal" case where it could have used indexes, so you may yet have more work to do...But this is what makes data programming fun, now isn't it?

              3. Pro SQL Server 2012 Practices Chapter 8: Release Management Review

                This past year, I contributed a chapter to an anthology book of best practices for working with SQL Server 2012 entitled Pro SQL Server 2012 Practices (http://www.apress.com/9781430247708). As authors, for publicity we decided to do summary reviews one another's chapters. There are lots of great technical sounding chapters, but when I picked, I picked a chapter that I hoped to help me learn more about a process that is not in my favorite normal design or coding techniques area. Of the parts of the software development process I despise, release management is definitely one of them. As an architect, my primary love in software development starts with design, and starts to really drop off during testing. And I certainly did learn more about the process… TJay Belt (https://twitter.com/tjaybelt) wrote his chapter on release management. (I should also divulge that I have been friends with TJay through SQL PASS for quite some time, along with many of the authors of the book too.)

                TJay does a great job of describing the process of release management, talking about the process he uses and even admitting mistakes he and his teams have made along the way as well. The focus of the chapter is very much from the point of view of the releasing DBA role in the process (most of the book is very DBA centric topics) and contains a lot of tremendously good advice about getting release management right starting with having great documentation and a rollback plan be able to restart or put a release on hold if things go awry. In addition, he covers many of the the topics around the entire process of coding/releasing software, including version control, proper (and quite reasonable) documentation, coding standards, and most of all a set of well-defined processes that all of the varied players in the process have agreed to and work on as a team.

                My favorite part of the chapter was the approximately four pages of thought provoking questions that should be covered when doing a release, ranging from understanding the databases that will be affected, capacity planning, tuning, standards, code, jobs, etc. etc. Great food for thought for defining or refining your own release process.

                Of course, one of the concerns of a book with lots of different topics is that you don't get tremendously deep coverage of any subject (and this is also true in my chapter on database design.) However, in some ways this liberates the writer from having to cover every detail and instead provide a thoughtful discussion of the overall release management process. This is very much a blessing, because every organization is different and already has some process in place already. Maybe your defined process is awesome or awful, but this chapter can help you think of ways to refine your process. You are left to find your own tools and processes to meet your company's needs, but what you get is quite thought provoking and will likely be useful whether this is your first time doing a release, or if it your hundredth.

              4. A wee bit exhausted… time to reenergize

                I admit it. I am tired and I have not blogged nearly enough. This has been a crazy year, with the book I finished writing, the pre-cons I have done (teaching is NOT my primary profession so I do a lot more prep than some others probably do), lots of training on Data Warehousing topics (from Ralph Kimball, Bob Becker, and Stacia Misner, to name three of the great teachers I have had), SQL Rally, SQL PASS, SQL Saturdays and I have gotten a lot more regular with my simple-talk blog as well… Add to this the fact that my daughter added a new grandchild to the family, and my mother has started to get so weak she is starting to fall down quite often (I am writing this blog entry from a spare bedroom at my mother-in-law’s house while my mom is in rehab!) and I am getting exhausted.

                Am I whining? Probably, but it is my blog! No, seriously I figure that occasionally you have to poke your head out from under the covers and write something and this is my something until after the New Year (other than posting a few already written and edited simple-talk blogs). I am on vacation from work for 2.5 weeks, and I don’t plan to do much with this laptop of mine for those two weeks unless the spirit hits me with an idea for a blog that I just have to write, but usually most of my blogs that have any technical or artistic merit take weeks to complete.  On the second of January, I hope to be back at it, analyzing my resolutions from last year, and making good on a few of them, particularly “Blog about my other (computer) love occasionally” and review some of the gadgets I have acquired as they pertain to doing my job as a writer/data architect. (Hint: My mother-in-law does not have Internet access, so some of the devices I have here are instrumental in my ability to work untethered for weeks on end.)

                So until next year, Merry Christmas, Happy Holidays, Happy New Year!  I hope your holidays are restful and fun.  I know part of mine will be because I intend to replicate this picture at least one or two more times next week, hopefully with a Turkey Leg in the hand that isn’t holding the camera taking the picture (all with my Windows Phone set on Battery Saver Mode, which delightfully turns off all syncing :)

                image

              5. PASS Precon Countdown… See some of you Monday, and others on Tuesday Night

                As I finish up the plans for Monday’s database design precon, I am getting pretty excited for the day. This is the third time I have done this precon, and where the base slides are very similar, I have a few new twists in mind. One of my big ideas for my Database Design Workshop precon has always been to give people to do some design. So I am even now trying to go through and whittle down the slides and make sure that we have the time for design.

                If you are attending, be prepared to be a team player. I have 3 team exercise that you will do in teams. When we reach the first exercise, we will break up into 8 individual teams. Don’t try to figure out who to sit by, because I am going to randomly choose how to split up into teams when I see how the tables are (and I know that there will be at least one person there that I would want on my team :). The teams will be slightly important  because the most enthusiastic teams will get the first crack at the pile of swag, of which I have a lot. I have 20 physical and 15 ebooks of my new database design book, 15 8GB SD cards with the PowerPoint and code on them, 3 Joe Celko books, the Apress Applied Mathematics for Database Professionals book and a very nice Lego set and if this blog entices more people to show up than I have giveaways, well, then I will pick up some gift cards to even out the swag.

                While the lecture will take up a lot of time, the exercises will be most fun part of the day. The exercises I have planned are of the following genre:

                1.  Modeling from requirements: Taking a set of written requirements and producing the initial database design (20 minutes)

                2.  Normalizing a set: Taking a flat file and normalizing it into a set (~20 minutes)

                3.  Applying what we have discussed: Taking a set of requirements and producing a normalized database design (45 minutes)

                The first two exercises, every team will have the same requirements, but the third will see me having 4 separate designs. So we will have 4 different designs to to discuss and review. I am bringing my camera along to use to display to the team’s work on the screen. After I print the requirement packs for the teams, I plan to go through and do my own design for comparison. It will be interesting to see how different each team’s design is, and to see what I might miss when I do the design. I am going to encourage people to go beyond the specific requirements and build the system they think will be awesome while meeting the requirements.

                If all works out, my hope is to do a series of blogs next year using the requirements and designs that we produce as a result. I also (finally remembered to) put a request on the slide that students could do one of a couple of design ideas and I would review them (yes, with plans to turn that into a blog someday too.)

                So hope to see you Monday… And if I don’t see you in the class Monday, see you Tuesday night when we do our annual Quiz Bowl. Tim has come up with a slew of interesting questions including another round of Before and After questions to blow the mind of several SQL Server professionals…

              6. 24 Hours of PASS next week, pre-con preview style

                I will be doing my Characteristics of a Great Relational Database, which is a session that I haven’t done since last PASS. When I was asked about doing this Summit Preview version of 24 hours of PASS, I decided that I would do this session, largely because it is kind of light and fun, but also because it is either going to be the basis of the end section of my pre-con at the summit or it is going to be the section of the pre-con we don’t get to because we are so involved in working out designs that we forget the time and the next day’s precon people start arriving and kick us out.

                The session is basically a discussion about the finishing touches that make a database better than average, something you can rave about, something you can brag to your significant other about, something your company will run a Super Bowl ad just thanking you for… Well, ok, seriously, a database that won’t cause you and your coworkers to ralph each time you use it is a solid step towards the way you will want to develop your databases. 

                The goal is to be reasonably like at a little bit fun, since I am doing the presentation at 11:00 PM Central Time in the US, and well, that isn’t exactly prime SQL time for most people. In Europe it will be the middle of the night, and in half of the US I will be competing with the national news and the end of the football game between the New York Giants and Carolina Panthers. If the game is close, I will be happy to share your attention, and heck, if my internet connection would support streaming video and the sharing client I would probably be watching the game myself (as it is, I will probably TiVo it and watch it on my phone via SlingBox when we are done…yes, I have a little bit of a football problem.)

                If you want to attend my session, click here and register. Even if database design isn’t your thing, 24 hours of PASS has (hold on to your hat) 24 different sessions in a 24 hour period to choose from. So click on over to the 24HOP Speaker/Session list and pick your sessions and register for them. I look forward to seeing you (well your name in the list) at the event.

                But db design is your thing (or you want it to be!), and you want to get a full day dose on the Monday before PASS, try my pre-con on Relational Database Design. It is going to be a great day, there will be plenty of learning, lots of swag (including at least 30 copies of my book to give away,) and some practical experience doing a bit of team based design. In any case it will be better than a normal Monday at the office.

              7. Utility Queries–Structure of Tables with Identity Column

                Edit: At the suggestion of a much knowledgable commenter who shall remain named Aaron, I changed from using schema_name() function to using sys.tables. When writing code that is expected to have reuse, it can be safer to use the tables rather than functions because the tables will work in the context of the database that is in the from clause, so if you changed the code to database1.sys.tables because you wanted the tables from database1, and you were executing the code in database2, the columns of the table would give you the answer you expected, but the functions would be context of database2.

                I have been doing a presentation on sequences of late (last planned version of that presentation was last week, but should be able to get the gist of things from the slides and the code posted here on my presentation page), and as part of that process, I started writing some queries to interrogate the structure of tables. I started with tables using an identity column for some purpose because they are considerably easier to do than sequences, specifically because the limitations of identity columns make determining how they are used easier.

                In the future (which will probably be after PASS, since I have a lot of prep and 3 more presentations to do before PASS), I will start trying to discern the different cases where you might want to use a sequence and writing queries to make sure the table structures are as I desire. The queries presented here are really the first step in this direction, as in most cases I foresee a mixture of identity and sequence based surrogate keys even once people get to SQL Server 2012 as a typical set up. The queries I am presenting here will look for tables that meet certain conditions, including:

                • Tables with no primary key – Very common scenario, no idea about uniqueness, or sometimes that identity property alone makes the table an adequate table.
                • Tables with no identity column – Abolutely nothing wrong with this scenario, as the pattern of using an identity based primary key is just a choice\preference.  However, if you you expect all of your tables to have identity columns, running this query can show you where you are wrong.  I usually use this sort of query as part of a release, making sure that the tables I expected to have a surrogate actually do.
                • Tables with identity column and PK, identity column in AK – This query is interesting for looking at other people’s databases sometimes.  Not everyone uses the identity value as a surrogate primary key, and finding cases where it is in a non-key usage can help you find “interesting” cases.
                • Tables with an identity based column in the primary key along with other columns – In this case, the key columns are illogical. The identity value should always be unique and be a sufficient surrogate key on it's own.  By putting other columns in the key, you end up with a false sense of uniqueness. Ideally, you want your tables to have at least one key where all of the values are created outside of SQL Server. Sometimes people with use this for an invoice line item and make the pk the invoiceId and an identity value like invoiceLineItemId.

                  I can’t say that this is “wrong” but if the only key includes a system generated value, it means that you can have duplicated data along with the system generated value. So you need to monitor the data more carefully.
                • Tables with a single column identity based primary key but no alternate key. – This is the classic ‘bad’ use of surrogate key abuse. Just drop a surrogate key on the table and viola!, uniqueness. If you can’t see why this wouldn’t be the desirable case, it is like the previous case, except the only uniqueness criteria is a monotonically increasing value.

                You can download the code directly from here  or you can see all my downloadable queries on my downloadable package page: DownloadablePackages.

                The queries:

                --Tables with no primary key

                SELECT  schemas.name + '.' + tables.name AS tableName
                FROM    sys.tables
                          JOIN sys.schemas
                             ON tables.schema_id = schemas.schema_id
                WHERE   tables.type_desc = 'USER_TABLE'
                        --no PK key constraint exists
                    AND NOT EXISTS ( SELECT *
                                        FROM   sys.key_constraints
                                        WHERE  key_constraints.type = 'PK'
                                            AND key_constraints.parent_object_id = tables.object_id )


                --Tables with no identity column

                SELECT  schemas.name + '.' + tables.name AS tableName
                FROM    sys.tables
                           JOIN sys.schemas
                               ON tables.schema_id = schemas.schema_id
                WHERE   tables.type_desc = 'USER_TABLE'
                --no column in the table has the identity property
                    AND NOT EXISTS ( SELECT *
                                     FROM   sys.columns
                                     WHERE  tables.object_id = columns.object_id
                                       AND is_identity = 1 )

                --Tables with identity column and PK, identity column in AK

                SELECT schemas.name + '.' + tables.name AS tableName
                FROM   sys.tables
                        JOIN sys.schemas
                            ON tables.schema_id = schemas.schema_id
                WHERE tables.type_desc = 'USER_TABLE'
                        -- table does have identity column 
                  AND   EXISTS (    SELECT *
                                    FROM   sys.columns
                                    WHERE  tables.object_id = columns.object_id
                                        AND is_identity = 1 ) 
                        -- table does have primary key 
                  AND   EXISTS (    SELECT *
                                    FROM   sys.key_constraints
                                    WHERE  key_constraints.type = 'PK'
                                      AND key_constraints.parent_object_id = tables.object_id )
                        -- but it is not the PK 
                  AND   EXISTS (    SELECT *
                                    FROM   sys.key_constraints
                                        JOIN sys.index_columns
                                            ON index_columns.object_id = key_constraints.parent_object_id
                                                AND index_columns.index_id = key_constraints.unique_index_id
                                        JOIN sys.columns
                                            ON columns.object_id = index_columns.object_id
                                                AND columns.column_id = index_columns.column_id
                                    WHERE  key_constraints.type = 'UQ'
                                        AND key_constraints.parent_object_id = tables.object_id
                                        AND columns.is_identity = 1 )

                --Tables with an identity based column in the primary key along with other columns

                SELECT schemas.name + '.' + tables.name AS tableName
                FROM   sys.tables
                         JOIN sys.schemas
                            ON tables.schema_id = schemas.schema_id
                WHERE tables.type_desc = 'USER_TABLE'
                        -- table does have identity column
                  AND   EXISTS ( SELECT *
                                 FROM   sys.columns
                                 WHERE  tables.object_id = columns.object_id
                                   AND is_identity = 1 )
                        --any PK has identity column
                  AND   EXISTS( SELECT  *
                                FROM    sys.key_constraints
                                           JOIN sys.index_columns
                                                ON index_columns.object_id = key_constraints.parent_object_id
                                                   AND index_columns.index_id = key_constraints.unique_index_id
                                           JOIN sys.columns
                                                ON columns.object_id = index_columns.object_id
                                                   AND columns.column_id = index_columns.column_id
                                WHERE    key_constraints.type = 'PK'
                                  AND    key_constraints.parent_object_id = tables.object_id
                                  AND    columns.is_identity = 1 )
                    --and there are > 1 columns in the PK constraint
                    AND (  SELECT  COUNT(*)
                           FROM    sys.key_constraints
                                      JOIN sys.index_columns
                                          ON index_columns.object_id = key_constraints.parent_object_id
                                             AND index_columns.index_id = key_constraints.unique_index_id
                            WHERE   key_constraints.type = 'PK'
                              AND   key_constraints.parent_object_id = tables.object_id
                        ) > 1


                --Tables with a single column identity based primary key but no alternate key

                SELECT schemas.name + '.' + tables.name AS tableName
                FROM sys.tables
                         JOIN sys.schemas
                             ON tables.schema_id = schemas.schema_id
                WHERE tables.type_desc = 'USER_TABLE'
                        --a PK key constraint exists 
                  AND   EXISTS ( SELECT * 
                                 FROM   sys.key_constraints 
                                 WHERE  key_constraints.type = 'PK' 
                                   AND key_constraints.parent_object_id = tables.object_id )
                    --any PK only has identity column 
                  AND ( SELECT COUNT(*) 
                        FROM   sys.key_constraints 
                                  JOIN sys.index_columns 
                                      ON index_columns.object_id = key_constraints.parent_object_id 
                                         AND index_columns.index_id = key_constraints.unique_index_id 
                                  JOIN sys.columns 
                                      ON columns.object_id = index_columns.object_id 
                                         AND columns.column_id = index_columns.column_id 
                        WHERE  key_constraints.type = 'PK' 
                          AND  key_constraints.parent_object_id = tables.object_id 
                          AND columns.is_identity = 0
                        ) = 0 --must have > 0 columns in pkey, can only have 1 identity column 

                  --but no Unique Constraint Exists 
                  AND NOT EXISTS ( SELECT * 
                                   FROM   sys.key_constraints 
                                   WHERE  key_constraints.type = 'UQ' 
                                     AND key_constraints.parent_object_id = tables.object_id )
                  

                --Test Cases

                --The following are some sample tables that can be built to test these queries. If you have other ideas
                --for cases (or find errors, email louis@drsql.org)

                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.NoPrimaryKey'))
                        DROP TABLE dbo.NoPrimaryKey;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.NoIdentityColumn'))
                        DROP TABLE dbo.NoIdentityColumn;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.IdentityButNotInPkey'))
                        DROP TABLE dbo.IdentityButNotInPkey;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.TooManyColumnsInPkey'))
                        DROP TABLE dbo.TooManyColumnsInPkey;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.MultipleColumnsInPkeyOk'))
                        DROP TABLE dbo.MultipleColumnsInPkeyOk;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.NoAlternateKey'))
                        DROP TABLE dbo.NoAlternateKey;
                IF EXISTS (SELECT * FROM sys.tables WHERE object_id = object_id('dbo.IdentityInAlternateKey'))
                        DROP TABLE dbo.IdentityInAlternateKey;

                --very common scenario, assuming identity makes the table great
                CREATE TABLE NoPrimaryKey
                (
                    NoPrimaryKeyId int not null identity,
                    AnotherColumnId int not null
                )
                go

                --absolutely nothing wrong with this scenario, unless you expect all of your
                --tables to have identity columns, of course...
                CREATE TABLE NoIdentityColumn
                (
                    NoIdentityColumnId int primary key,
                    AnotherColumnId int not null
                )
                go

                --absolutely nothing wrong with this scenario either, as this could be desired.
                --usually it is some form of mistake in a database using surrogate keys though
                CREATE TABLE IdentityButNotInPkey
                (
                    IdentityButNotInPkeyId int primary key,
                    AnotherColumnId int identity not null
                )
                go

                --absolutely nothing wrong with this scenario either, as this could be desired.
                --usually it is some form of mistake in a database using surrogate keys though
                CREATE TABLE IdentityInAlternateKey
                (
                    IdentityInAlternateKeyId int primary key,
                    AnotherColumnId int identity not null unique
                )
                go


                --In this case, the key columns are illogical. The identity value should always be unique and
                --be a sufficient primary surrogate key. I definitely want to know why this is built this
                --way.  Sometimes people with use this for an invoice line item and make the pk the
                --invoiceId and an identity value like invoiceLineItemId. I generally prefer the surrogate key
                --to stand alone and have the multi-part key to be something that makes sense for the user
                CREATE TABLE TooManyColumnsInSurrogatePkey
                (
                    TooManyColumnsInPkeyId int identity,
                    AnotherColumnId int,
                    primary key (TooManyColumnsInPkeyId,AnotherColumnId)
                )
                go

                CREATE TABLE MultipleColumnsInPkeyOk
                (
                    TooManyColumnsInPkeyId int not null,
                    AnotherColumnId int not null,
                    primary key (TooManyColumnsInPkeyId,AnotherColumnId)
                )
                go

                --this is my pet peeve, and something that should be avoided. You could end up having
                --duplicate rows that are not logical.
                CREATE TABLE NoAlternateKey
                (
                    NoAlternateKeyId int not null identity primary key,
                    AnotherColumnThatShouldBeUnique int not null
                )
                go

              8. SQLPASS DB Design Precon Preview

                It is just a few months left before SQLPASS and I am pushing to get my precon prepped for you. While it will be the second time I produce this on the year, I listened to the feedback and positive comments I have heard from potential attendees, so I am making a couple of big changes to fit what people really liked.

                1. Lots more design time. We will do more designs in some form, as a group, teams, and individually, depending on the room and people in attendance. (Figure on a lot of databases centered around toys, theme parks, and other situations that are not exactly serious, since they provide a limited enough case where no one will get hung up on how their company does it, but broad enough to mimic real business cases. )
                2. Pattern and code walkthroughs. I have a set of patterns (like uniqueness, hierarchies, and data driven design) that we can walk through and see how to translate from a database design to a physical implementation. It is based on the presentations I have done for the Data Architecture Virtual Chapter, and at Devlink this year, but we will not blast through any of it and will cover the code and designs in a deliberate pace and then consider designs where the pattern would make sense.

                So if you want an interactive experience where you get a chance to think for yourself (at least part of the time) come join me on November 5 in Seattle, Washington, don't think it, just do it: http://www.sqlpass.org/summit/2012/Registration.aspx (Not responsible if you actually get carried away and your employer won't cover your expenses)

                As a bonus, I have at least 30 books I will give away to attendees, 15 electronic and 15 ex-tree versions to share with you. The precon is largely taken from the book, but it would take me more than 7 hours to just read the book to, and I am afraid that would not impress anyone at all.

                If you want to see more of my thoughts on the pre-con, check out the interview PASS did for the pre-con here, it is wordy, but if it wasn't it would be mathematics: http://www.sqlpass.org/summit/2012/Sessions/PreConferenceSessions/PreConPreviews/LouisDavidson.aspx

                If you have any questions to ask me about what we will cover, or what you want to cover, or want to know I think I am funny, don't hesitate to go ahead and register…send me an email to drsql@hotmail.com.

              9. And interview, an online session, a long drive and a SQL Saturday… This week!

                Later this week I will be doing an episode of the Greg Low’s excellent SQL Down Under podcast (http://www.sqldownunder.com/Resources/Podcast.aspx), something I did once before back in 2006.  If you haven’t listened to any of the previous editions, there are some amazing people who have been on his podcast.

                On Thursday at 12:00 Central Time, I will be doing a presentation entitled Designing for Common Problems in SQL Server for the PASS Data Architecture Virtual Chapter.

                Friday I will be driving up to Cleveland, OH for SQL Saturday 164. I will be doing the Designing for Common Problems in SQL Server session, along with the Sequences session that I have done at several SQL Saturdays so far.  Saturday I will give away two copies of my brand new book, one in each session, so if you want to be the first person I give one to, be there!

                Right now, the biggest issue is that the Designing for Common Problems session is WAY too long. In my prep so far, I have gotten halfway through with the patterns and code in one and a half hours. So who knows what I will do to cut down the time, either limit the patterns, or perhaps split the session? I will figure something out… at least on Saturday when I have real people I can poll the audience to see what they want to see in detail. Online pretty much all you see are people’s names and the clock ticking away.

                I have a few other things coming up, including picking speakers for Nashville’s SQL Saturday, shipping out books to my SQL Rally attendees, and Devlink at the end of the month (when I will have a bit longer to the Common Problems session, thankfully), but more on that after this weekend.

              This Blog

              Syndication

              Links to my other sites

              Powered by Community Server (Commercial Edition), by Telligent Systems
                Privacy Statement