primary key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jisuprusty
    New Member
    • Mar 2008
    • 7

    primary key

    hi ,
    help me
    How is it possible to create a primary key if already a primary key is present in a table ?
  • prohan
    New Member
    • Apr 2008
    • 2

    #2
    Does the table have any data in it?

    If not, you could simply drop it, recreate it and then create the correct Primary key constraint.
    But you have to be careful of Foreign key references in tables that are children of this one.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      There can be only one Primary key in a table.

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Originally posted by jisuprusty
        hi ,
        help me
        How is it possible to create a primary key if already a primary key is present in a table ?
        There can be only one primary key on the table. Either with single column or multi column (composite key)

        So you need to drop the existing one and create a new one. Remember if you create a new one as composite key and any column has a duplicate or null value then you will not be able to create the primary key.

        Comment

        Working...