SQL Server Performance

identity key

Discussion in 'SQL Server 2008 General Developer Questions' started by raviatvns, Mar 2, 2011.

  1. raviatvns New Member

    do i use identity column as a foreign key
  2. Adriaan New Member

    If you do, you do. And if you don't, you don't. What was your question, again?
  3. FrankKalis Moderator

    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.
  4. satya Moderator

    I doubt this is a classroom/interview based question...
  5. FrankKalis Moderator

    [quote user="satya"]
    I doubt this is a classroom/interview based question...
    [/quote]
    if so, there are smarter questions out there.
  6. jcelko New Member

    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.
  7. satya Moderator

    Hey Joe,
    Welcome to the forums.
    Glad to see your inputs here...hope to see them regularly, your insights are very helpful.
  8. mmarovic Active Member

    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.
  9. mmarovic Active Member

    [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.
  10. satya Moderator

    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.
  11. jcelko New Member

    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.
  12. Luis Martin Moderator

    [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.
  13. mmarovic Active Member

Share This Page