Category: Uncategorized

  • Table Variables

    I was never a big fan of temp tables, mostly because there were serious contention issues in SQL Server v6.5. I know things were better in v7.0, but I managed to learn to code without them, so I have avoided them for years.

    When table variables came, I was in the habit of not using temp space, so I didn’t use them much, but I have seen them used more and more and decided to experiment a little with the recently.

    I looked at the Table Variables article on SQLServerCentral as well as this article on Table Variables and a KB article. Without digging into pros/cons, etc. here’s a little code:

    I can create a table like this:

    create table TableVarMatch(
    Myid int
    , myChar varchar(20)
    )
    go
    insert TableVarMatch select 1, 'A'
    insert TableVarMatch select 2, 'B'
    go
    select * from TableVarMatch

    This gives me two rows back, as you would expect. I can do the same thing with a table variable:

    declare @MyTableCar Table
    ( MyID int
      , MyChar varchar(20)
      )
    insert TableVarMatch select 1, 'A'
    insert TableVarMatch select 2, 'B'
      
      select * from @MyTableCar

    And just like a table, I can actually insert data from another table:

    declare @MyTableCar Table
    ( MyID int
      , MyChar varchar(20)
      )
      
      insert @MyTableCar select * from TableVarMatch
      
      select * from @MyTableCar

    This can be handy for small data sets. I think I’d use this if I quickly needed to store some data in a series of steps instead of a temp table, and if I couldn’t materialize a CTE, this would work well.

    You can’t index these, and just like temp tables, these will get loaded into tempdb if needed, but it’s a handy construct that can be returned from a function (TVF). Definitely something that I need to play with a little.

  • Pre/Post Cons for the PASS Summit

    I woke up this morning to find Kathi Kellenberger disagreeing with Andy Leonard’s blog on picking the pre/post conference speakers. I read through both, and found myself in the middle of the debate.

    I sense from frustration from Andy, and I certainly have felt that way. A few years ago, three or four, there were very few pre or post conference sessions to attend. I had a friend speaking in one of them and as we had a few drinks after his long day, he mentioned he made five figures, in US dollars, for an 8 hour workday.

    I was stunned, jealous, and a little annoyed that I hadn’t seen a call for those speakers. If I knew about it, I might have submitted something. Heck, I feel like I should submit something for basic SQL Server training, and see if I can draw an audience.

    The last couple years at least, there have been a lot of pre/post con choices, and there have been a lot of speakers. I think PASS has realized this is a decent revenue stream and ought to promote it, so they’ve expanded the choices. Good for them, and good for us. People like the sessions, and after sitting in on a part of one, I have to say that I think it’s worth the $400 for a day of training. Just be sure you take notes, lots of them.

    However the incentive (a big payday), and the demand from more people to speak, means that PASS can’t just cherry pick Kalen Delaney and Kimberly Tripp as speakers. They need to formalize the requirements, as Andy has called for, and I think the list of 9 requirements is a start. You need to meet 4 of them, and they look like they’re tailored to be sure that certain people meet requirements. They’re not that bad, though since I meet 4 exactly.

    The Intent

    These pre/post conference sessions are worth money. Both to speakers and PASS, and I think that the selection has to balance a few things. They have to pick speakers whose names are known. They have to pick topics that people will pay for. I probably meet one of those requirements (the former), though I can perhaps come up with something for the latter. Now will people pay for training from me? Who knows.

    And I’m not sure the selection committee knows. They’re volunteers, and I’m hoping that they use some type of data from surveys or data from some source. However my guess is they take a WAG.

    While I can’t say I think that the selection process has been fair, or that it will be fair in the future, I do this this is a good move. It’s a move towards transparency, and I think that’s good. In the past, I think all speakers have been selected with vague requirements, and often based the committee’s personal feelings towards people, or their attitude towards people.

    That’s human. I can’t say that I wouldn’t be biased towards picking Andy Leonard or Andy Warren for slots. They’re friends, and that’s natural. I do think they’re smart, I’ve seen their writing, and heard them talk, so I think they ARE good choices, but I don’t have data to back things up.

    It seems that PASS is slowly opening up, publishing requirements, and hopefully will continue to publish more information on *WHY* they made decisions on things. I don’t think we need to know who voted how on each speaker, but we ought to get some explanations on why people/sessions were or were not picked. I’d like to see all the pre/post submissions and comments from the committee picking them.

    Actually I might be on that committee. I know I’m on one of them, and I’ll disclose what I can on the process this year. I’ve complained before, so this is my chance to step up and do something about it.

    I think that PASS has been biased, and not necessarily serving everyone in the community in the past, but as they grow, it seems they are slowly starting to make changes and I think the publication of this criteria is a good step.

  • Why Doesn’t My Audit Track Anything

    When you create a server audit, one of the things that might surprise you is that the audit doesn’t record data. So you create an audit for failed logins, as I did recently. You then login:

    DisableAudit_01

    Using a bad password will get you this:

    DisableAudit_02

    When you check the logs

    DisableAudit_03

    you see:

    DisableAudit_04

    What’s wrong? By default, when you create an audit, it isn’t enabled, so no data gets logged. You can enable it easily:

    DisableAudit_05

    And then when you have a failed login:

    DisableAudit_02

    You’ll find data in the logs:

    DisableAudit_07

    It’s a small detail, but one you want to keep in mind as you create audits. Be sure that they are enabled before you walk away from your production systems.

  • Memorial Day

    A holiday in the US, commemorating the men and women who have died in the service of our country.

    Most years in the US, I’ve spent the day with family, starting summer, and while we remember those in the military, it’s primarily been a time where we spend time with each other, often doing something as a family. We’ve used the time to go away, usually taking a long weekend camping or traveling around.

    This year my son is participating in a Scout event, commemorating those that have died from our local area, at a local cemetery. He is hoping to serve our country in the Marine Corps at some point in his life, so this is a meaningful holiday for him, and I’m proud to be there helping him celebrate it.