Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: Finding out unique columns

    Hi,
    Is there any SQL I can run against a DB2 table to figure out which columns have unique constraints? i.e. the values in the column have to unique.

    I don't care if the column is an index or not.

    Thanks.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Look in syscat.tabconst

    Andy

  3. #3
    Join Date
    Jan 2006
    Posts
    119

    Thanks.

    Thanks for that.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    All unique constraints (including PK's) must have a matching unique index defined. If a unique index does not already exist, DB2 creates one when the constraint is created.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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