‎2007 Apr 17 12:06 PM
Is it possible two primary keys for one database table ? tell me indetail
‎2007 Apr 17 12:09 PM
hi
yes the tables can have one or more primary keys...the combination then becomes primary key(composite key)
for ex:
in the table VBAP - VBELN & POSNR are both primary key fields.
the combination of keys that you define as 'KEY' while creating a DB table becomes primary key.
regards,
madhu
‎2007 Apr 17 12:12 PM
Hello Amar,
It is possible to have more than one primary key anyhow u can see in anyof the table u can find two primary keys in which on is Client (mandt) and atleast a single primary key field related to the table .
so u can have ..........
regards
‎2007 Apr 17 12:13 PM
Hi Reddy,
Welcome to SDN...
Yes, You can have one or more keys to be primay keys for a table.
These primay keys combination is called composite primay key and it will uniquely identifies an entry in a database table.
When creating database table, Give the Key field to be check for the fields which you want to be primay keys.
Thanks,
Vinay
‎2007 Apr 17 12:32 PM
HI,
U can have two or more fields in the primary key of a db table. This type of key is composite primary key. but u can't have more than one primary key for a table, i.e more than one composite primary key.
Combination of primary key fields uniquely identifies the record present in the data base table.
‎2007 Apr 17 12:36 PM
hi Reddy,
You can have multiple primary keys in ur transparent table .
The group of primary keys are called as composite Key .
For all the fields you want to define as a primary key ,tick mark the respective fields on the right side .
General you should keep all the primary keys on the top of your Trans. Table.
While writing a select querry use the max number of primary keys as that helps
in better performance.