Author: way0utwest

  • Cleaner Code Demos – Speaker Hints

    Recently I had the privilege of watching Paul Randal and Kimberly Tripp present (separately) at SQL Server Connections. If you have never seen them talk I would highly recommend you make time if you are ever at an event with them. They do a fantastic job.

    In any case, they used SSMS quite regularly to show how various things worked in SQL Server. The thing that struck my quite quickly was the easy in which I could see what they were doing, and they could also track where they were in a large complex script.

    Typically when I see someone using Management Studio to present it looks like this:

    SSMS_present_1

    Granted, this is small, but when it’s projected on a screen, it’s not likely to be much better. The important stuff, the query, and the results, are actually a little hard to see.

    When I watched Kimberly do this, I saw this for the query:

    SSMS_present_2

    With this appearing after execution

    SSMS_present_3

    A couple things to notice here. First, under the main tab, in this case for SQLQuery1.sql, there are two sub tabs. One is the editor, so you can see lots of code (at font size 12). The other is the results, and when I execute a query, SSMS automatically switches to the results tab.

    However not only do I have results, but I also have the query at the top. That easily lets me determine what I’ve just run. When you’re doing a few things, either on stage or at work, having the query shown is very, very handy.

    How To Set This Up

    First, auto hide the Object Explorer and save yourself some space. You can get the menu below by clicking the little triangle in the Object Explorer header bar.

    SSMS_present_4

    First let’s set up results. I would change the results to text by right clicking in the query window:

    SSMS_present_7

    Next, you want to go to the Query menu, and select the Query Options item. In this dialog, there are a few things to configure. First is the results item. Choose text and check the these three items:

    • Include the query in the result set
    • Display Results in a Separate Tab
    • Switch to results tab after the query executes

    SSMS_present_8  

    Then you want to up the font so things are easier to read. I do this first in the Text Editor (see the drop down at the top)

    SSMS_present_6

    Then do this for the text results, changing the drop down again.

    SSMS_present_5

    Now when you run a query, you’ll automatically switch over to a screen that is easier to read on a projector. And you’ll see the query you just ran, so it’s easier to keep track of where you are in your presentation.

    I actually like these settings so much, I use them for any work I do in SSMS.

  • My Weekend Just Got Busy

    I’m traveling to New York City on Friday for SQL Saturday #59 and returning Sunday morning. As soon as I get home, I’m heading to Winter Park for a week’s vacation for the Thanksgiving holiday. We were actually supposed to leave Sat, and my wife still might. So I’m planning on getting home from the airport, having things packed, and be ready to head to the mountains.

    I was expecting to give my Modern Resume presentation and a short lunchtime SQL Source Control demo. As if that weren’t busy enough, I heard from SQL Saturday #59 yesterday that they were going to take me up on a previous offer to do an early morning “SQL Wake Up” at 8, while people are registering and eating breakfast. I also was asked to do a few SQL Saturday remarks during the opening session, so I have a little prep to do.

    With me being gone next week, this already is a busy week, but adding in a SQL Saturday trip means I am going to be really busy this week.

  • Another Plagiarizer

    I received a note today about someone else that is plagiarizing content from SQLServerCentral. It’s a blog on Windows Live Spaces by 岩松 in Peking. I won’t link it here, since it’s not important.

    There are any number of articles copied, with no attribution listed whatsoever. This person is from Peking, and lists their occupation as SE, which I am guessing is software engineer.

    I did try to contact them, as I usually do, but their privacy settings prevented me. So I sent a copyright violation to MSN.

    I read Brent Ozar’s post yesterday on plagiarism, and I somewhat agree, somewhat not. On one hand I get that cultures view this stuff differently, and laws are viewed/enforced differently. However leaving aside all the legal stuff, what about this:

    Do you ever feel that it’s moral for you to take credit for someone else’s work?

    I can’t imagine any culture supporting this. Does anyone want to tell their kids they can copy someone else’s work so they don’t have to learn in school? If your neighbor’s kid cut someone’s grass or performed a chore, would you send your kid out to the person’s house to get paid and take credit for the work?

    I don’t think most people would. But that’s what they’re doing when there’s no attribution or credit. I get that you might want to “share” information, but why not link back to the first site? At the very least it would raise both your search engine ratings and spread the information further.

    Why else would you blog? To get a job? That’s immoral. You’re implying you know how to a) do the task and b) communicate well. At least one of which you haven’t done, and you’re deceiving the person reading it.

    Make money from Google ads? Again, you’re implying you deserve the results from work you didn’t create.

    There’s no good excuse for re-posting someone else’s work and saying that you deserve credit for it. At least Cook’s Source gave people credit, and just violated copyright law.

  • Google Scale

    I heard someone talking the other day about how Google needs to optimize their code. They really pay attention to low level operation of their software, actually having people spend time writing compilers and ensuring they generate efficient code. This is on top of the idea that they want to ensure data structures efficiently use space, there is no unnecessary network traffic, etc. The reasoning is that at “Google-scale” (Gs) if something takes 10% longer, that’s 10% more electricity they have to supply, 10% more machines, and 10% of the Google IT infrastructure budget is a big, big number.

    I’ve never worked at Gs. In fact, I’ve never worked at 0.001Gs. Most of my work in software development has been to support dozens, or maybe hundreds of users. SQLServerCentral, which was a joint programming project, was my largest piece of software , and that was built on other pieces of software, with little contributions from me and lots of Andy Warren’s keyboard sweat in the early years. Despite working on small projects, I still have always learned to consider the little things.

    When you grow up with compilers that take minutes, as in 10 minutes to compile a few hundred lines of code, you pay more attention to your algorithms. When you grow up with kb of memory, you use it wisely. When you work across a 300 baud modem, you don’t mess around with lots of data transfer. Even though many of those constraints don’t apply, I still try to be careful and watch my data types, watch my round trips, and be aware that there are actually bits being whipped across the ether or in and out of transistors in a not-so-little package on my computer system.

    The argument about “just buying more hardware” has some validity, but it’s not an excuse for not improving your skill and becoming better at your craft. As my friend Jeff Moden often quotes, it doesn’t take any more time to do it right the first time. That’s true, but you need to know how to do it right, we at least well. For all of us, that should mean some regular effort to improve your skills and become better at your craft, just like Google looks to constantly optimize their own systems.

    Steve Jones