There is a mistake in the article.
Where it says "Returns a value of 5.", the line above should be scope_identity() instead of @@identity
I think that the fact that there are assumptions makes it even better. In a case like this, conversation is necessary. It's developers or DBAs going off half-cocked that very often causes problems. That there could be problems forces a person to evaluate the possible problems using a solution would cause. Sure, it'll take possibly a full minute (with the discussion of the environment) instead of 5 seconds to give a solution, but it'll be a solution that will work with less chance of failure.
Excellent Article.This is the problem wih every dba /developer
if you are senior and started carrier from sql server 7.0.
Now again this is year their is need of lot of learning for Yukon.
which is complete rewrite, not patch work to sql2000
I think it's a fair/decent question. A good job candidate should be prepared to ask the only relevant question when presented with this question: "What is the scope?" That's the only piece of information you need in order to determine which method of returning the last inserted identity value is appropriate.
Another good interview question involves how to retrieve a GUID after an INSERT.