cancel
Showing results for 
Search instead for 
Did you mean: 

adding second primary key in hana

raghavendra_k1
Explorer
0 Kudos


Can Anybody help me in altering table having primary key want to add another primary key(writing sql script in hana for adding second primary key )?

raghav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Its simple

ALTER TABLE "ID158443"."TCURF" ADD PRIMARY KEY (MANDT , KURST , FCURR , TCURR , GDATU);

if u have already primary key ,,  and alter gives error in this case first drop existing primary key constraint

and create the new one

raghavendra_k1
Explorer
0 Kudos

hi thanks but now I am getting "duplicate index name" errorr any suggestions?

christianschuer
Employee
Employee
0 Kudos

Hi,

Did you drop the primary key before (ALTER TABLE schema.my_table DROP PRIMARY KEY)?

Are there any referential constraints towards the table set?

Regards

Christian