Tag: syndicated

  • Why I’m raising my son to be a nerd

    A good read, from ESPN and CNN columnist, LZ Granderson: Why I’m raising my son to be a nerd.

    We need more STEM (science, technology, engineering, and mathematics) education in this country, and probably in all countries.

  • New Connect Item – TDE

    Does the certificate matter for TDE? Apparently not as I found a number of people discussing the fact that the expiration date for certificates is not checked for TDE restores. So if your certificate expires, you can still restore the TDE backup.

    However the documentation doesn’t mention this, and I think it ought to be clarified, so I submitted this Connect item. Feel free to vote if you agree:

    https://connect.microsoft.com/SQLServer/feedback/details/677365/doc-clarify-the-expiration-date-field-of-certificates-impact-on-tde

    Whether the expiration date should matter is another debate. I think it should, but I need to really think about the pros and cons of this.

  • A Lost Day

    I’m not sure what happened, but I had some sort of stomach bug yesterday. I was up throughout the night in the wee hours of Monday with cramps in my stomach or intestines and feeling miserable. Slightly better at 7:30am, I got up and tried to work. Even made some coffee, got a large glass of water and then realized at 9 that I couldn’t work. Lots of painful cramps, and I’d only managed a few sips of coffee and decided to go back to bed.

    I could have tried to work some, but it was a struggle to concentrate on anything, so I lay in bed, reading a bit, but mostly trying to sleep away my misery. With a long weekend coming up (6 day holiday) and then a trip to the UK the following weekend for SQL in the City, I didn’t need this. In fact, I couldn’t really spare the day as I need to prep SQLServerCentral for my time away along with reviewing and editing my presentation.

    However life gets in the way. I could have stressed and tried to work last night, but I decided that I needed to get better and rest, and I did get to spend a little time with my little girl. She was happy to watch a movie and snuggle in the afternoon with Dad, and so I tried to enjoy that.

    Work isn’t smooth. It has bumps, there are times that I need to work long hours to get things done, working late into the night or the weekends. So I’ve learned to relax and not worry about those days that I need a break as well.  Finding that balance in work and life is important, and health is one of those areas that I think work needs to take a backseat to.

  • HASHBYTES – A T-SQL Function

    Someone was asking if the HASHBYTES function was a good one to use in T-SQL as far as performance goes.. I wish I had a good reference for the function, but the best one I had on SQLServerCentral was this piece on using it to load a data warehouse. I also wrote an editorial on it not working with strings beyond 8k, which seems to be a bug, or a lack of resources devoted to ensuring string functions work with varchar(max).

    The HASHBYTES function returns a hash of an input string. A hash is essential a calculation based on the values of the input, and two inputs that are the same, ought to produce the same hash. One catch with this function is that you provide the algorithm used, which can be one of these:

    • MD2
    • MD4
    • MD5
    • SHA
    • SHA1

    Each of these produces different output, returning a varbinary(max) value. As an example, suppose I hash “Steve Jones”

    SELECT HASHBYTES('MD2', 'Steve Jones') 'MD2'
    UNION
    SELECT HASHBYTES('MD4', 'Steve Jones') 'MD4'
    UNION
    SELECT HASHBYTES('MD5', 'Steve Jones') 'MD5'
    UNION
    SELECT HASHBYTES('SHA', 'Steve Jones') 'SHA'
    UNION
    SELECT HASHBYTES('SHA', 'Steve Jones') 'SHA1'
    
    

    The results look like this:

    MD2

    ———————————————-

    0x27851A666BFCB4A35F971DD742CDA15F

    0x2E978DE4841B1F3651A8DF4B2D2CF5F5C624A76B

    0x75931813C7EAAEAB3CD1D8D621935903

    0x979AC597C05CA6DE3A88C31A456D1125

    As you can see, there’s a different hash for the same value using different algorithms. However if I were to compare the same string to itself, I can easily tell if something has changed. If the hashes aren’t the same, there’s a difference. I’m not sure this is a great use, but the more obvious use is that I can hash a password and then have the user enter their own version, hash it, and compare the results. In this way, the system never needs to know the value.

    Just make sure you use the same algorithm Winking smile