lundi 9 février 2015

Best practice - Update Primary Keys


What's you opinion about Update a primary Key in SQL?


I have a "link" table with 3 key from 3 other tables. Should the administration let people to edit one of the keys? I usely said no, dont change PK. Add a new line and if you want remove the other line.


sample:


Table A : idA Int Table B : idB Int Table C : idC Int


Table Link : PK { idA, idB, idC }


UPDATE [Link] SET idA=@NewIdA





Aucun commentaire:

Enregistrer un commentaire