You hardly would use an IDENTITY column as a foreign key. You may however use it as a primary key in your parent table and then use a column of the same type in a child table to create the constraint between both tables.
[quote user="satya"] I doubt this is a classroom/interview based question... [/quote] if so, there are smarter questions out there.
IDENTITY is the count of the physical insertion attempts to a table. Why would you think that it can ever be a key in a properly designed RDBMS? Please read any book on data modeling and RDBMS.
Hey Joe, Welcome to the forums. Glad to see your inputs here...hope to see them regularly, your insights are very helpful.
Sorry, I have slow connection here and it appeared to fail once, then the response appeared twice. Somehow I do not see an option to delete post, so please read next one. @moderators: Please delete this one if possible.
[quote user="jcelko"] IDENTITY is the count of the physical insertion attempts to a table. Why would you think that it can ever be a key in a properly designed RDBMS? Please read any book on data modeling and RDBMS. [/quote]I don't know what is properly designed RDBMS according to you. However, this is MSSQL Server forum and identity can be a primary key and it shouold be in most cases.
I would still agree with Joe's comments that MSSQL is built upon RDBMS principles, why would it is different to that.... in terms of architecture.
Real SQL programmers never use IDENTITY at all. It is the count of the physical insertion attempts. That is physical meta data and is not RDBMS.
[quote user="jcelko"] Real SQL programmers never use IDENTITY at all. It is the count of the physical insertion attempts. That is physical meta data and is not RDBMS. [/quote] Modesty is not your best virtud. Anyway, welcome to the forums.
Well, you might be one of a few "real sql programmers" in the world, however, people building real application doing real tasks use identity with a good reason.I stated my opinion about the topic here: http://mirko-marovic-eng.blogspot.com/2011/01/natural-vs-surrogate-keys-that-is.html