Author: way0utwest

  • Achievement Unlocked: Balance 0

    Earlier this week I got a notice that I hadn’t completed a task this year. It’s one that I’ve rarely finished in the past, and probably not in any year in the last 10. However I decided this year that I should buckle down and get this done. I’m proud to say that I spent about an hour working on the task and got it done.

    What was the task? Taking all my vacation.

    I’ve got some amazing benefits from Red Gate Software, and my holiday allowance is one of them. However I’ve often struggled to allocate out my time, and with travel and my concerns over keeping this site running, I usually carry over a few days. I often sell a few back as well, and I’m actually glad that there are limits on both of those actions. If left to my own devices, I might become much more unbalanced than I have been in the past.

    I had a couple of weeks left, but to keep SQLServerCentral running in top form and ensure that you are getting information to help you improve your SQL Server skills, I can’t disappear on short notice. As a result, I’ve spread out my time off across the rest of this year and will be absent a number of days in December. Some is real vacation, some are days off that where I’ll have to decide what I want to do with the time.

    I know far too many people in technology skip vacations or don’t plan enough time off. I’ve been trying to get better at this each year, and I’m happy to say that I’ve finally managed to use up all my holiday for 2014. Don’t be like me. Schedule your time off and take it. Recharge, refresh, and enjoy the rest of your life. Remember that you work to live, you don’t live to work.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.2MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • Practical Problems with CI

    I agree. Continuous Integration has issues in the real world, at least it probably does in many companies. The more tests you have, the more likely you refactoring or changes will break something. The more things break, the more people will look to leave them alone, deferring the "fix" into the future.

    This defeats the purpose of CI. The whole idea is to keep your software in releasable condition. That way you can push it out if you need to.

    How do you deal with the constant build breaks? The first thing I’d do is see if I mad a mistake and can fix my code. That should be the first reaction.

    The next thing is stop for a moment and see what tests are failing. It’s entirely possible that the tests aren’t valid or aren’t needed. Maintenance of tests is an issue. If this is a test that regularly breaks, I might call a quick meeting and see if we should remove it.

    The last thing is that I’d rollback my code and then go back to work on it. Perhaps there’s another way to solve the issue and not break the build.

    This isn’t magic. It’s also not easy. However if you are keeping up with your CI process and it’s healthy, I believe it will pay off over time with better software.

  • SQL Konference 2015

    My first speaking date of the new year is scheduled. I’ll be at the SQL Server Konference 2015, near Frankfurt, Germany. Red Gate arranged things, and I’m looking forward to heading over and renting a car to drive in Germany.

    And speaking, of course.

    I don’t know the agenda or details, or which session I’m presenting, but it’s exciting.

    Slightly bittersweet as I won’t make SQL Saturday #358 in Albuquerque. I’ve been to the last two, taking a day to ski at Taos, but I can’t make it this year as I’ll be speaking that week in Europe.

  • T-SQL Tricks – Custom Templates

    I wrote about the Template Explorer, which comes with the SQL Server tools and is visible in Management Studio (SSMS). It’s handy, but there are limited code items in there. What if I want more?

    That’s easy. Suppose I decide that I often need to create procedures with the EXECUTE AS clause. I usually do this:

    CREATE PROCEDURE MyProc
       @id INT
    WITH EXECUTE AS OWNER
    AS
    BEGIN
    
    -- do work
    BEGIN TRY
    
      COMMIT
    END TRY
    BEGIN CATCH
      ROLLBACK
      EXEC uspErrorHandler;
    END CATCH
    
    END

    It’s a basic template of stuff I do. Let’s stick this in our Template Explorer.

    The first thing I do is go to the Stored Procedure folder. I can right click it and I’ll see this:

    templates12

    I choose template and a new one is created. I enter a name and I have a template. The first 6 templates here are defaults. The last one, highlighted below, is the one I created.

    templates13

    Now I right click it again and select Edit. At this point, it will open in a query window. This is just a file in my file system (under ), and like any other query, I can edit it. I paste in my script from above, and change a few items to parameters.

    templates14

    Now I can save this, and the next time I need this, just drag it into the main window and customize it.

    templates15