Subject Re: Changing field all places
Author Michael Vilhelmsen <Michael.Vilhelmsen@M
Thank you for your answer.

I have the same oppinion as your as your kolleques.

But the design of this DB those, that I have to do this.


--- In, Paul Vinkenoog <paul@v...> wrote:
> Hi Michael,
> > I have a table (MyTable) with a primary key.
> > This primary key is of type varchar(30) not null.
> >
> > Now one of our customers want to change this.
> > My problem is, that it is linked to other tables.
> >
> > Can I do smething, to change to condition of this field, so that
> > upon change the DB will change it in all places where it is being
> > reference as a foreign key ?
> Yes, when you define a foreign key you can add: ON UPDATE CASCADE
> I don't think you can change this behaviour for an existing FK
> You'd have to first drop the FK and then recreate it with ON UPDATE
> CASCADE added.
> BTW - People who know much more about database design than I do
> tell me:
> a) never use a PK which has "business meaning"; use a generated PK;
> b) never ever let your end users touch the PK of any table.
> Greetings,
> Paul Vinkenoog