Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How many primary keys use in one table

Former Member
0 Kudos

Hi,

Please help me. Maximum How many primary keys use with in one table

Regards,

Sunil Kumar.T

11 REPLIES 11

Former Member
0 Kudos

You can have only one primary key for a table.

You can make 16 fields to form one primary key.

Former Member
0 Kudos

Dear Friend,

In a table more than one primary key is possible and that is known as Composite Primary Keys.

Regards,

Brijraj Rathod

prasanth_kasturi
Active Contributor
0 Kudos

hi

a table has only one primary key,

a primary key can contain more than one field calld key fields.(its called composite primary key).A maximum of 16 key fields per table is permitted

the maximum length of the primary key is 120(sum up all the lengths of individual keys).

hope its clear.

reward if helpful

prasanth

Former Member
0 Kudos

Hi Suneel,

In version 4.6.

A maximum of 16 key fields per table is permitted. The maximum length of the table key is 255.

If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.

Above 5.0 version primary keys allowed is 532.

You can create max of 512 Primary key columns in a Table .

If found helpfull do reward.

Regards.

Eshwar.

Former Member
0 Kudos

Hi

You can use maximum of 16 primary keys in a table.

Thanks

Satish

Former Member
0 Kudos

Hi

You can only Have one primary key in table.

Rewards points if useful

Regards

Nikunj Shah

Former Member
0 Kudos

Hi,

For my knowledge, It depends on the Database & version u r working.. Right..

This is a sample description what I seen for a Database...

Technical Specification of SAP DB Version 7.4

Description Maximum Value

Database size 32 TB (with 8 KB page size)

Number of files/volumes per database64...4096, specified by a configuration parameter

File/volume size (data) 518 ...8 GB (dependent on operating system limitations)

File/volume size (log)1 6 TB (dependent on operating system limitations)

SQL statement length>= 16 KB (Default value 64 KB, specified by a system variable)

SQL character string lengthSpecified by a system variable

Identifier length 32 characters

Numeric precision 38 places

Number of tables unlimited

Number of columns per table (with KEY) 1024

Number of columns per table (without KEY) 1023

Number of primary key columns per table 512

Number of columns in an index 16

Reward Points if useful

Former Member
0 Kudos

Hi

As per my knowledge you can create maximum of 16 key fields and their length should be 255.

please rewards point if helpful.

Former Member
0 Kudos

Hi Sunil,

Why no reply..

Won't you find some answers from the replies..

No rewards too..

Regards,

Former Member
0 Kudos

hi,

A maximum of 16 key fields per table is permitted. The maximum length of the table key is 255.

If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.

may be this is useful,

regards,

dilip

former_member194613
Active Contributor
0 Kudos

I don't really understand the question, as the name says there can only one primary key all others are secondary keys.

The primary key consists out of the fields marked in the table see SE11.

Index is a better name for key, because key can be misunderstood as kef field

All indexes in the SAP system are composite indexes, but there is still only one primary.

And now what is the question? You can define secondary keys if you need.

The number of key fields is rarely an issue because the first unique set is sufficient, and that are rareley more than 10 fields.

Siegfried