November 21, 2011 at 8:32 pm
Jeff, are you referring to the IGNORE_DUP_KEY option?
November 21, 2011 at 9:51 pm
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
Change is inevitable... Change for the better is not.
November 22, 2011 at 2:19 am
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
November 22, 2011 at 6:16 am
Now THAT I agree with. It is a bit of an oolie.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply