Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How many primary key constraints can we have in a table of ms-access?

How many primary key constraints can we have in a table of ms-access?

Scheduled Pinned Locked Moved Database
question
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sivakumar mariappan
    wrote on last edited by
    #1

    Hi, How many primary key constraints can we have in a table of ms-access? Any other constraints available in ms-access other than primary key? Please share your ideas... Thanks, Sivakumar.M.

    L R N 3 Replies Last reply
    0
    • S sivakumar mariappan

      Hi, How many primary key constraints can we have in a table of ms-access? Any other constraints available in ms-access other than primary key? Please share your ideas... Thanks, Sivakumar.M.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      One table, one primary key. You can verify this in the documentation[^]; "You can use the PRIMARY KEY reserved words to designate one field or set of fields in a table as a primary key. All values in the primary key must be unique and not Null, and there can be only one primary key for a table."

      I are troll :)

      1 Reply Last reply
      0
      • S sivakumar mariappan

        Hi, How many primary key constraints can we have in a table of ms-access? Any other constraints available in ms-access other than primary key? Please share your ideas... Thanks, Sivakumar.M.

        R Offline
        R Offline
        riced
        wrote on last edited by
        #3

        As Eddy said one primary key per table. But you can create indexes on non-key fields and set them to not allow duplicates. Effectively giving you a constraint that the column must contain unique values. It's also possible to allow two (or more) columns to have duplicates while the combination of the two columns is unique - again by creating an appropriate index.

        Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis

        1 Reply Last reply
        0
        • S sivakumar mariappan

          Hi, How many primary key constraints can we have in a table of ms-access? Any other constraints available in ms-access other than primary key? Please share your ideas... Thanks, Sivakumar.M.

          N Offline
          N Offline
          Niladri_Biswas
          wrote on last edited by
          #4

          How many primary key constraints can we have in a table of ms-access?

          Ans: Only 1. Not only in MSAccess, in any database i.e. Oracle, Sql Server etc. It is a general database rule.

          You can have many FK and Composite keys however.

          Any other constraints available in ms-access other than primary key? Ans:

          Yes.

            Primary key constraints
            Foreign key constraints
            Check constraints
            Check constraint expressions
            Unique constraints
            Default constraints
          

          A little search in google gave me the second answer

          http://office.microsoft.com/en-us/access/HP030838791033.aspx[^]

          Hope it helps :)

          Niladri Biswas

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups