Skip to Content

Primary key

In a database table maximum how many primary keys can we have?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

18 Answers

  • Posted on Jan 04, 2008 at 09:46 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 10:23 AM

    A table always can have only one primary key. May be number of fields of a table be the part of primary key.

    If number of fields are there as primary key then it is called combined primary key, but combination of all fields work as if one.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 10:42 AM

    Hi Paromita,

    I think that it is version dependent.

    In the SAP DB version 7.4 the default maximum number of primary key columns is 512 per table.

    Regards,

    Charles

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 10:45 AM

    each table can have only one primary key

    it is a possibility thta one or more fields make that primary key

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 11:22 AM

    Hi paromita

    a table can have only 1 primary key.

    Thanks and Regards

    Shivika

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 01:40 PM

    Hi,

    In a table we can have only one primary key combination.that primary key combination can be formed from 16 fields. (these primary key fields should be together and in the first part.after wards only non-primary key fields should be included.otherwise error will get ).

    So we cant assign more than 16 fields to primary key combination in datbase table in sap in 4.6 C version.

    i tried the same thing.It will not take more than 16 fields.Log wil be generateg you can see there error very clearly.

    Table ZDEPT has more than 16 key fields (violates SAA standard )

    Regds

    Sivaparvathi

    Please dont forget to reward points if helpful...

    Edited by: Siva Parvathi on Jan 4, 2008 2:41 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2008 at 09:03 PM

    Check this thread.

    fields in a database table

    Regards,

    Maha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 08:57 AM

    hi

    u will have any no. of primary key fields in a table.

    regards,

    hema.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 09:12 AM

    Hi Paromitha Roy,

    It is not depending on the fields it is depends on length you can check the fields as key fields up to the sum off these field length is equal to 120.

    Note: your can create table with 16 key fields and the total length is not greaterthan 120.

    Plzz Reward if is useful,

    Mahi.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 09:25 AM

    a table has only one primary key... but it can bea combination of more than one key fields

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.