Tag: syndicated

  • 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

  • Why Two Devices

    I used to travel with two laptops, one as a backup, however lately I’ve switched to taking the iPad and a laptop. The iPad doesn’t double as a backup, but it does let me do things like take notes at events or conferences with an extremely long battery life. My laptop only gets 2-2.5 hours, and when you’re on the go for 10 hours, you need something else. I also use the iPad for demos of SQL Monitor, from Red Gate, using http://monitor.red-gate.com/ 

    However I’ve been tempted to get a real second machine, something that is truly a backup. I read Brent Ozar’s post on his MacBook Air, and it’s really tempting to get one of those, especially as I use VMware, which works agree both Mac and PCs.

    Seth Godin as another interesting argument for a second machine. Use one for pleasure, or distractions, and one for work. That’s not bad, but I kind of do that with my phone. I read on it and listen to music, as a break from the laptop (or sometimes in conjunction with it).

    I’m a practical guy, and don’t want to get (too many) gadgets for fun, especially laptops. I went through that last year, going from a Win 7 tablet to the iPad, which was a good move for me. At least my daughter thinks so.

    For now I think I’ll stick with just the iPad and my Lenovo. However when I look for a new laptop, I have to say that the MBP will be high on my list, just to try something new.