Category: Uncategorized

  • Recharging

    I was hoping that 4 days in the mountains would be a nice time to recharge. Unfortunately, with my wife needing to work some of the time, Kyle coming back early for school, and me getting hurt, it seems that I didn’t get a lot of time up there. I barely feel like we got away, as opposed to some of our long weekends last year.

    It’s important to recharge, and get away from work. I’ve balanced things pretty well over the last few years, working from home, but I’ve also not taken a lot of vacation. And I’ve found that taking a day here and there hasn’t helped since I still get caught in the grind of working more the day before and after. A little of that happened this time.

    I think that I might take a note from some of the people I listen to on the radio, like Jim Rome, and shut things down for a week at a time this year. I’ll be picking out some low traffic times and then trying to take a whole week off here and there. We’ll see how that works out.

    One nice thing about the condo we hit in the mountains. It didn’t have free wi-fi available, so I was offline most of the time. It didn’t make sense for me to fire up my netbook and check mail or anything and pay a fee each day, so I left it off until the last night. That was a nice chance to get away from the site for a few days.

  • Identity Values – Two things to know

    I saw someone post a question recently about running out of identity values in an INT column. It happens, it’s happened to me, and I’m not surprised. They couldn’t go to a bigint because of their application, so they asked if they could “renumber” the identity column.

    Of course you can, and it’s simple with DBCC CHECKIDENT and the RESEED parameter. As I  and others explained that, the person seemed to think that this would renumber his data and he’d be fine.

    Uh,  no.

    There are two things you need to know about the identity.

    1. They only work on the next value being inserted.

    2. They have nothing to do with current values in the table.

    A lot of people think that auto number means that the server tracks what’s in the table and then bases the next number on that. Not so. Just as many people have done when they’ve stored the “next” value in another table and used that in their own autonumber scheme, that’s what SQL Server does. They have a better implementation than you get in T-SQL and they handle large sets of rows inserted at once better, but they still just track what the next value to be inserted is. Try this:

    CREATE TABLE MyTable
    ( id INT IDENTITY(1,1)
    )
    GO
    INSERT mytable DEFAULT VALUES
    GO
    SELECT * FROM mytable
    GO
    DBCC CHECKIDENT( mytable, RESEED, 1)
    GO
    INSERT mytable DEFAULT VALUES
    GO
    SELECT * FROM mytable
    GO
    DROP TABLE dbo.MyTable

    What are the results?

    You might expect 2 1s, but you get this:

    ident_a

    If I change the reseed parameter to 0, then I get this:

    ident_b

    So you can see that the “last” value is being stored for the identity column. However note that there’s no checking of what’s in the table? The reseed merely changes that “last” value and so when the database engine goes to insert a new row, it increments this value, regardless of what’s in the table.

    If I wanted to prevent duplicates, I’d need a unique index. Nothing to do with the identity property.

  • Blog Cleanup

    Awhile ago I set up a separate site for my editorials. They are copyrighted by me, and I lost some of them in a migration by Red Gate to new servers a few years ago. From 2005 and earlier, it appears that the editorials I wrote are gone, which really annoys me. It’s my fault for not saving them, and I am still hoping to track them down at some point.

    That experience had me worried about trusting another IT staff with my own writings, so I started keeping a copy at https://voiceofthedba.wordpress.com/. I’ve been posting copies of the editorials there, at the same time they publish on SQLServerCentral, so I have an online backup.

    However when I started, I began using the “categories” of WordPress as the “tags” that I use on SQLServerCentral. That’s not what I intended, and since this was a backup, it wasn’t until I realized that I had a few dozen menu links at the top of the page that I decided to fix it.

    Since it’s a hosted service, I had to go back and manually start cleaning categories and adding tags. At the time, I had 70 editorials up there, so this wasn’t a pleasant process. I kept it in the background, slowly working my way through old posts and fixing them. A lesson to be learned here, mess around with the features quickly, and fail early. Make your changes when you have 10 posts, not 70.

    My plan is to also move this SQL blog over there, using the export/import features, and take advantage of a single place for the “Steve Jones” publishing world. It’s a part of cleaning up my brand publishing, and I will add it to my Modern Resume presentation as an example of how I work on my brand, while not depending on my employer.

  • Is it a problem if I don’t blog?

    I’ve had a few people ask me this question. It’s the new year, many people are making New Year’s resolutions, and in the technical world I know a lot of people have said they’ll start blogging, or blogging more.

    Let me say that a lack of a blog is not a negative.

    I don’t think it counts against you in an HR search, an employer doesn’t look down on you, and it doesn’t mean that you’re not a good potential employee, just because you don’t blog. From the questions I’ve asked of many people, it doesn’t hurt you to not blog. I know, double negative, but I wanted to make the point.

    However

    The power of a blog is that it enhances your reputation. Ultimately you have to impress a potential employer with your work. You have to demonstrate the knowledge in the interview, so why not do a little of it ahead of time? Put some of that knowledge in a blog and show them ahead of time that you’re someone they might want to hire.

    A blog makes you stand out, it gets you moving up the Long Tail. That’s what you want, to stand out a bit, to increase the chances that your resume stands out among all the other ones.