How to update primary key
- by slave016
Here is my problem:
I have 2 tables:
1.WORKER, with coloumns
|ID|OTHER_STAF|
, where ID is primary key, and
2.FIRM, with coloumns
|FPK|ID|SOMETHING_ELSE|
, where combination FPK and ID make primary key, and also ID is a foreign key referenced to WORKER.ID (not null, and must have same value as in WORKER).
I want to make stored procedure UPDATE_ID_WORKER, where I would like to change the value of specific ID in WORKER, and also in all instances of specific value of ID in FIRM.
stored procedure:
........
@id
..
????
........
Thanks for every advice...