Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003

    Unanswered: Identity Column (Auto INcrement by 1)...does it need a constraint???

    I am building a new database of 34 tables. All tables are going to have the primary key as an identity column that auto-increments by one. Is there any need for me to specifically set a constraint on the tables saying that this identity column must be unique? It seems redundant.

    I ask because DB2 will let me do it, but it seems redundant and unnecessary. Anyone have an opinion? Sorry if this is basic...I am relatively new a DB design.


  2. #2
    Join Date
    May 2003
    When you specify a primary key, it automatically creates a unique index on the column(s), unless you already created one yourself (if you created the index first and then later altered the table to create the primary key).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts