Hi guys,

if a create unique index on column, which is not primary key, it is make from this column, after put index on it, primary key ? Or, just to avoid duplicate data in this column?

Views: 12

Reply to This

Replies to This Discussion

Usually a unique index that is not a primary key is created to just avoid duplicate data. There can be cases where SQL access can happen via the unqiue index rather than primary index.

If the new column must be part of the primary key then it should be added there . But this all depends on application design. 

Thank you

Regards

Eswar

RSS

Bringing Db2 enthusiasts together virtually. Expert or novice, distributed or mainframe, this is the place for everything DB2.

Top Discussions 

User Groups

Blog Posts

New SQL pagination syntax - a Db2 12 greatest hit with John Campbell

Posted by Paul McWilliams on May 22, 2018 at 21:25 0 Comments

Db2 12 for z/OS introduces new SQL syntax that makes the difficult task of coding efficient SQL pagination—returning a portion of a result set based on data position—much easier for application developers. Read more in…

Continue

Videos

  • Add Videos
  • View All

© 2018   Created by Surekha Parekh.   Powered by

Badges  |  Report an Issue  |  Terms of Service