missing records on table

  • Jeff, are you referring to the IGNORE_DUP_KEY option?

  • Yes. Between those types of indexes and triggers, people can get quite confused when things don't operate as expected simply because they're "hidden" functionality. I believe the interviewer was using such an example to find out if the OP knew of such "hidden" functionality or, at the very least, what the OP would check for if such a thing actually happened.

    And, yes, the ignore duplicate index would issue a warning whereas a trigger's only hint would be more than one row count for the insert (provided that SET NOCOUNT was OFF and it was an AFTER trigger), which would have been my next question if I were giving the interview and the OP answered the first question correctly. When I find someone really "hot" in the world of SQL Server and want to hire them, I really test their metal for two reasons... 1) To see just how "hot" they really are so I can tell my boss "I told you so" if they don't hire my recommendation and 2) to see how they react on the drill-drill down for tivial minutia.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Jeff Moden (11/20/2011)


    GilaMonster (11/19/2011)


    For the record, this is a stupid interview question. It's another 'read my mind' kind of question that generally serves just to make the interviewer feel superior.

    I don't see it that way at all. I think it's one of those "thought provoking/discuss it with me" questions designed to instill the fact that you "cannot safely assume anything about the table" and that the interviewer was looking for the interviewee to bring up such "possibilities" as indexes and triggers because most people don't even think about such things. 🙂

    Depends whether the interviewer has AN Answer that is Right and anything else the candidate comes up with is Wrong, or whether the interviewer is looking for possibilities and a discussion.

    If the former, it's a stupid interview question

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Now THAT I agree with. It is a bit of an oolie.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply