Josue Maldonado wrote:

> Hi list,
> 
> I altered a table def and added a new field pretended to be used as 
> PK, from
> SQL studio what command should I use to populate this field having 
> each row
> on the table with a unique value in that field. (kinda counter could 
> be nice).
> 
> Please, provide me with the code to do this.

If you only want to be sure of uniqueness in that field, the standard
SQL-statement
CREATE UNIQUE INDEX <indexname> on <tablename> (<that column_name or a list of 
column_names>)
will help.

If you want to have this single column as the primary key, get rid
of your old primary key (if there is one)
according to alter table
http://www.sapdb.org/htmhelp/6d/117c1ad14811d2a97400a0c9449261/frameset.htm
--> drop definition
http://www.sapdb.org/htmhelp/d7/efa64e014c11d3a97d00a0c9449261/frameset.htm

and then add a new primary key according to alter table (see above)
--> add definition
http://www.sapdb.org/htmhelp/d7/efa64b014c11d3a97d00a0c9449261/frameset.htm
--> key_definition
http://www.sapdb.org/htmhelp/6d/117c62d14811d2a97400a0c9449261/frameset.htm

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

Reply via email to