Andreas Ernst wrote:

> 
> i want to add a primary key to a table.
> 
> As i read in the documentation:
> 
> --------------------------------------------------------------
> ---------------------------------
> A key definition in a CREATE TABLE statement [Page 113] or an ALTER 
> TABLE statement
> [Page 130] defines the key in a base table. The key definition is 
> introduced by the keywords
> PRIMARY KEY.
> Syntax
> <key_definition> :: PRIMARY KEY (<column_name>,...)
> --------------------------------------------------------------
> ---------------------------------
> 
> So i did:
> 
> alter table server_benutzer add primary key (server)
> 
> The column server already existed.
>
> I used SAP DB 7.3.024 on W2K
>
> Error message:
>
> SAP DBTech SQL: [-7002] Message not available
> -7002: KEY not allowed

Please check if a primary key is already defined for this table.
In systemview COLUMNS this can be seen.
One table is only allowed to have 0 or exactly one primary key.
If one exists and another should be specified the first has to be dropped
and the new added afterwards.

I can only imagine, that there is a primary key defined for this table
and then the error would be ok.

Elke
SAP Labs Berlin



_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to