Author: way0utwest

  • Happy Easter 2011

    Happy Easter

    This weekend is the Easter holiday weekend around the world and with today being Good Friday, it’s a vacation day for me.

    The ski slopes are closing this weekend and if the weather is good, I’ll be heading up for one last day of sliding down Copper mountain today. Winter is when I tend to take a lot of vacation and this weekend is the end of that season for me.

    Hopefully everyone is having a quiet day if you are at work, with nothing broken and no deployments scheduled over the holiday. I know that holidays are often the best time for deployments to occur for the business as there are less people working on the systems. When I worked as a production DBA, especially in places where the systems were usually in use 24 hours a day by other employees, holidays were the only time we could schedule extended outages.

    As much as that can be frustrating to IT people that want to get a break on the holidays, I think that the IT business, like some other businesses, require you to trade some holiday work for time off at other parts of the year. My previous careers in the restaurant and hospitality business had me working many holidays, and I know that many people in retail positions also end up working holidays like Easter.

    My advice to find a balance in your life is to negotiate a rotation for IT covereage on holidays and perhaps even ask for two days off if you have to work this one holiday. There are lots of progressive companies that do recognize a hardship for holiday work, but plenty of others that don’t have an IT policy since most workers take the holiday off. People that work on an hourly basis usually get twice their rate for holiday work, why not salaried IT workers?

    Enjoy the weekend and enjoy the blooper reel today.

    Steve Jones


    The Voice of the DBA Podcasts

  • Saying Thank You

    This plane left without me 😦

    Recently I had problems with one of my flights. That’s nothing new, and as Grant Fritchey noted, I tend to anger the travel gods for some reason and often find myself in situations that make me regret ever leaving the ranch. In this case, I flew to the Dallas-Fort Worth airport, which was fairly close to SQL Saturday #63. I attended the event, and drove back early Sunday morning in time to have some coffee before my flight. I walked in, went straight to security with no bags to check and a mobile boarding pass. I scanned my phone 4 or 5 times before the security guard told me to leave.

    Actually he didn’t tell me to leave, and was very polite in asking me to go check with the airline for a new boarding pass. The airline agent informed me that my flight was out of Love field (new service starting that day) and despite my early arrival, I wouldn’t make it to Love field in time.  I was stunned as I had booked a flight like I normally do: pick an outbound flight, then an inbound one. I  have never been presented choices from a different airports for the return flight, but in this case that was what happened.

    I could have gotten upset, especially after spending 5 hours in the DFW airport waiting for another flight. Instead I tried something else. I sent a nice note to Expedia, letting them know that despite my issues, I am pleased with the way that they provide a booking service on the web. I have used their site for years, and it’s been a nice tool for me, allowing me to keep all of my data in one place. Their services have expanded over time and I like their service. I then told them of my issue, and noted that it might have been a bug or a glitch, but in any case, it was an inconvenience for me.

    It was a strange situation for me, and a convergence of a few things. My inattention to detail, new service for an airline, and a large city with multiple airports. I rarely fly to cities with more than one airport to choose from, and was willing to accept some of the blame. However I also know that application developers try to build applications that work, and a little praise is always appreciated.

    Steve Jones


    The Voice of the DBA Podcasts

  • Building an algorithm

    When I was in college, and even high school, all of my computer science classes required me to build algorithms. Often they were simple things, like implement a sort, or reverse a string, or shuffle a deck of cards. Those seemingly silly and trivial exercises, however, build the skills of pattern recognition and implementation in computer science. Sometimes I think we don’t do enough of that for people that are tackling computer careers these days.

    I saw a post from someone that had an incrementing column, an identity, that impacted another field. Basically whenever the first column reached “10”, you wanted to add one to the second column.

    Easy, right? I think so, and to show someone how they might create an update statement, or even see the pattern, I built a quick tally table.

    SELECT Top 205 IDENTITY(INT,1,1) as N
      INTO Tally 
      FROM master.dbo.syscolumns SC1, master.dbo.syscolumns SC2

    From there, I then looked at the pattern. Every 10 items, I need to add one. That’s a pattern, and the way that pattern is easily discerned in math is with a modulo operation. To the rest of the world, that’s a remainder. If you look at the pattern of remainders of an increment divided by 10, it’s this:

    n           modulo

    ———– ———–

    1           1

    2           2

    3           3

    4           4

    5           5

    6           6

    7           7

    8           8

    9           9

    10          0

    11          1

    12          2

    13          3

    14          4

    15          5

    16          6

    17          7

    18          8

    19          9

    20          0

    21          1

    22          2

    from this code:

    SELECT Top 205 IDENTITY(INT,1,1) as N
      INTO Tally 
      FROM master.dbo.syscolumns SC1, master.dbo.syscolumns SC2
      
    
    SELECT n
      , n % 10
     FROM Tally  
      
    DROP TABLE tally

    That mans that we can see each time there is a zero remainder, we want to perform an increment. So essentially if you detect an update, do a modulo, and get a zero, then you update the next column.

    It gets a little more complicated if there can be multiple rows updated or added at once, but here is the overall code that essentially builds a table of numbers that increment for each 10 on the previous value.

    SELECT Top 205 IDENTITY(INT,1,1) as N
      INTO Tally 
      FROM master.dbo.syscolumns SC1, master.dbo.syscolumns SC2
      
    DECLARE @b INT
    
    SELECT @b = 1
    
    SELECT n
      , n % 10
      , @b
      , n
      , @b + (1 * (n / 10)) 'col b'
      , CASE WHEN (n % 10) = 0 THEN 'add 1' ELSE '' END 
     FROM Tally  
      
    DROP TABLE tally

    You end up with this:

    n                                   n           col b      
    ———– ———– ———– ———– ———– —–

    1           1           1           1           1          
    2           2           1           2           1          
    3           3           1           3           1          
    4           4           1           4           1          
    5           5           1           5           1          
    6           6           1           6           1          
    7           7           1           7           1          
    8           8           1           8           1          
    9           9           1           9           1          
    10          0           1           10          2           add 1

    11          1           1           11          2          
    12          2           1           12          2          
    13          3           1           13          2          
    14          4           1           14          2          
    15          5           1           15          2          
    16          6           1           16          2          
    17          7           1           17          2          
    18          8           1           18          2          
    19          9           1           19          2          
    20          0           1           20          3           add 1

    21          1           1           21          3          
    22          2           1           22          3          
    23          3           1           23          3      

    If I had started at zero, you’d see a more traditional increment of 0 for column b to start with.

  • The Mentoring Experiment

    The Mentoring Experiment
    http://thementoringexperiment.org/

    As I have progressed through my career, I’ve worked hard, read and studied constantly, and asked lots of questions of others. All that has helped me to improve my skills and better understand my craft. However there is more to growing a data professional career than just learning to better work with the technology.

    One thing that helped me a few times was the ability to talk to other people in my companies that were more experienced in life and business. These were people that I reported to, directly or indirectly, who were willing to listen and offer me some insight and advice on my career. They were mentors, but unfortunately they were few and far between in my career.

    It made me wonder if I might have made some better decisions, or made different decisions earlier in my career if I had been able to call on a mentor more regularly.  Andy Warren (LinkedIn | Blog | @sqlandy) and I talked about this being a problem that we both shared in our careers, and one that we see many people struggling with today. Our discussions led us to wonder if there might be a way to develop a mentoring framework that would help people grow their careers in a way that is better suited to each individual.

    The Mentoring Experiment is our initial attempt to build such a framework. It’s a short cycle, with the idea that we are seeking to learn some lessons about mentoring while helping people with advice and insight from mentors that we respect.  We hope that we can find some patterns that allow us to facilitate the bonding of mentors with mentees.

    We are taking applications until Apr 30, and while Andy and I will be mentoring people, we have a list of mentors from the SQL Server community that we respect and think will be good mentors for data professionals looking for help in better understanding their careers and where they want to go in the future.

    We’ll be blogging about the process, respecting everyone’s privacy along the way, and we hope to expand and grow this experiment over the next few years into something that gives back to the community, and hopefully helps many data professionals grow careers that they benefit from and greatly enjoy.

    Steve Jones


    The Voice of the DBA Podcasts