cancel
Showing results for 
Search instead for 
Did you mean: 

is it always compulsory to have primary key in the table??

Former Member

is it always compulsory to have primary key in the table??

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Akshay,

Primary key are defined in SQL as an UNIQUE constraint with NOT NULL columns.

Only one set of primary keys is allowed on one table.

In simple words, primary keys are fields that are unique. it is very much necessary, it helps in uniquely identifying every record in a table.

Former Member
0 Kudos

hi

Basically primary key is used to relate the tables,in future you may come across a situation where you need to get the table contents which you have created ,in those cases the declaration of primary key is

helpful.

It is up to you that whether you need the table in future or not.

it is advisable to declare.

Regards,

ASIF.

sbalakrishnan
Discoverer
0 Kudos

Hi Akshay,

It looks like specifying a primary key is not required while defining a table. I checked it on HANA.

I didnot specify primary key and created table.

It will be interesting to think how each row will be considered unique, indexed. Also how the data changes will be handled.

Thanks,

Sreejith Balakrishnan

Former Member
0 Kudos

But some one has answered dis ques as,it is mandatory.....Then which one is correct?? i am confused now.

I am ABAP fresher.

former_member193464
Contributor
0 Kudos

yes in abap it is must...
create a table without a primary key in data dictionary and you will know....