Tag: syndicated

  • Final Prep for SQL in the City

    I can’t believe this will be the fourth SQL in the City in London next week. It’s amazing to me that we’ve managed to build this great series of one day events that is so popular with SQL Server professionals.

    I’m heading back to London next week, a quick trip, but one I enjoy (once I’m there), as I get to see lots of old friends and meet new ones at the event. It’s always fun, and despite the long trip, it’s worth it.

    However I still have lots of prep. A few days off  this week to spend with my kids (I’ve been gone too much lately), so I’ll be pressed to finish my talks this week, and then have lots of rehearsals next week before I fly (and probably more while flying).

    If you’re in the UK and can get to London next Friday, we still have some space, and we’d love to talk to you about better database development, and administration, for your SQL Servers.

  • SQL in the City 2014 – Two countries in two weeks

    I have had a fairly busy travel schedule the last few years. While I don’t love sitting on airplanes and being away from home, I do look forward to the events and seeing the amazing #SQLFamily and community we have for SQL Server. I’ve also learned a few tricks to make travel smoother, which reduces stress.

    It’s a good thing since the SQL in the City 2014 event schedule is going to be short in duration, but long in miles. We have two days coming this fall: London and Seattle. We open in London on Fri, Oct 24, 2014 and then a little over a week later will be in Seattle on Mon, Nov 3, 2014. It’s a packed schedule that has me flying 6,000 miles to the UK before returning home and getting ready for a 1,300 mile trip up to the Pacific Northwest.

    However I’m excited for both events. London draws a bit crowd, with a variety of SQL Server professionals that are excited to learn new ideas, tips, tricks, and tools to help them in their professional work. We’ll once again be near the center of town, at St Grange, just off the St Pauls and Blackfriars Underground stations.

    Seattle is a great town, and while I’m sure I’ll see some Summit attendees, I look forward to meeting lots of local SQL Server data professionals that won’t attend the Summit. I hope that if you’re in the area, you come to our event. After all, how can your boss say "no" to a free day of training? Especially if you’re not attending the Summit later that week. We’ll be at McCaw Hall, near the Space Needle.

    It’s a short tour this year, but an exciting one. We’ll also continue to expand our SQL in the City seminars to other cities in the future, and hope we get the chance to meet more of you as we look to support, educate, and participate in this amazing SQL Server community.

  • Making Better Presentations–Practice

    This is part of a series of tips for speakers on how to make your presentations better.

    There’s one thing that makes a big difference for many speakers.

    Practice

    Practice makes perfect, but more importantly, practice develops familiarity. Everyone gets a little nervous on stage, everyone struggled to memorize their entire talk. The best presenters learn to minimize the amount of thinking they need to do on stage, and build a smooth flow of topics.

    It’s important for you to practice your talks so that you become comfortable with the flow and ordering of your slides. I have typically done the following when I build a new presentation

    • Practice sections as I create them – Actually run through the words in my head.
    • Practice the entire talk of slides out loud – I may do this a few times in my office.
    • Record myself giving the talk and watch for the flow – I rarely do this anymore, but I have done it quite a few times when I was beginning speaking. Even now I’ll see recordings of myself at times and see things I want to improve or remove in my style.
    • Run through the talk the night before, often in my head, quickly, but covering each slide and demo.

    Above all, practice with your demos and code. Learn to move around the system easily and smoothly. Being able to select icons, hit shortcuts, select code, etc. makes your presentations smoother, but it’s also handy in your work. Having these tools quickly move in and out of your way make you a more efficient worker.

    The big things I’d tell people to understand is how to switch to and from Powerpoint. Note that you don’t need to stop the presentation to switch. ALT+Tab to your other application and ALT+TAB back to Powerpoint. The presentation itself will be an app separate from Powerpoint. It will take you 30 seconds to figure it out, but practice.

    Practice, practice, practice.

    Remember, amateurs practice until they get it right. Professionals practice until they don’t get it wrong.

  • Testing your API

    I think learning to better test our software, including the database objects, is one of the ways in which we’ll build better software applications in the future. Testing is a complex subject, but this is part of a series that looks at ways in which you can use tSQLt.

    Checking Table Metadata

    One of the easy tests you can write is to compare the meta data of an object to a known quantity. The easy way to do that in tSQLt is to use the AssertResultSetsHaveSameMetaData function. This function compares the structure of two result sets, covering names, ordering, and data types, to determine if they are the same.

    Here’s a quick example of how that’s done.

    Let’s assume I have this table:

     create table Articles  (
        [ArticlesID] [int] identity(1,1) not null,
        [AuthorID] [int] null,
        [Title] [char](142) null,
        [Description] [varchar](max) null,
        [Article] [varchar](max) null,
        [PublishDate] [datetime] null,
        [ModifiedDate] [datetime] null,
        [URL] [char](200) null,
        [Comments] [int] null
      );

    If I wanted to write a test in tSQLt to check this table for changes or alterations, here’s what I’d do in code:

    create procedure Articles.[test Articles_Check_metadata]

    as

    begin

      –Assemble

    create table Articles.Expected

      (

        [ArticlesID] [int] identity(1,1) not null,

        [AuthorID] [int] null,

        [Title] [char](142) null,

        [Description] [varchar](max) null,

        [Article] [varchar](max) null,

        [PublishDate] [datetime] null,

        [ModifiedDate] [datetime] null,

        [URL] [char](200) null,

        [Comments] [int] null

      );

     
      –Act

     
      –Assert

    exec tsqlt.AssertResultSetsHaveSameMetaData

      @expectedCommand = N’select * from Articles.Expected’,

      @actualCommand = N’select * from articles’

      ;

    end

    ;

    go

    Note that I don’t have an ACT section in this test.

    The Assemble section is easy. I record the size and shape of my table. This will be what I compare the actual table to in the database.

    The Assert section is a call to AssertResultSetsHaveSameMetaData, with a SELECT * from the real table being compared to the same SELECT from the expected result table I created. If these match, I pass the test. If they don’t, the test fails.

    Why?

    This seems silly, I know. What does it matter if the table changes, and it certainly will need to change. I definitely questioned the value of a test like this when I first saw the example. However when I thought about it, and thought about the places in which I’ve developed databases, this makes some sense.

    Imagine that I have 3 or 4 (or more) developers. As we get new requirements, we’ll change the schema over time. Imagine that I actually have views built on this table, and other procedures and functions, all of which have some tests on them. If I change this schema, and run a test suite, I could see multiple failures. If I did that, one would hope I realized that the addition of a column here (or a rename) would cause those issues. However if I changed a couple things before running a test, which is something I might do at times, having this test fail tells me quickly that the schema was altered. If someone else changed the schema, I also quickly see that this change was to the schema.

    It’s not a big change, but it does allow me to determine that I need to refactor all the objects (potentially) that depend on this table. I can go do that work now, or add it to the list of tasks for this particular development task, and also fix the tests, which should go quickly.

    If the work doesn’t go quickly because I have a lot of objects, then I’m really glad that I learned now this is an issue.

    This becomes even more valuable with views and procedures returning result sets. If I add a column, then I may or may not want views to change, but certainly a check of view meta data will tell me if they do.