changing primary key (1 Viewer)

ssh

Registered User.
Local time
Today, 03:07
Joined
May 22, 2002
Messages
49
How to change primary key in main table and in subtable at once?
 

Len Boorman

Back in gainfull employme
Local time
Today, 03:07
Joined
Mar 23, 2000
Messages
1,930
Cannot be done

Need to delete Link

Change each table in turn

Remake link


Len
 

namliam

The Mailman - AWF VIP
Local time
Today, 04:07
Joined
Aug 11, 2003
Messages
11,695
Me 2 think cannot be done... do like above...
 

Pat Hartman

Super Moderator
Staff member
Local time
, 22:07
Joined
Feb 19, 2002
Messages
43,603
Cascade Update

As long as your primary key is not an autonumber, it can be done. You need to establish a relationship and select the enforce Referential Integrity option. That will open up the cascade delete and cascade update options which you also need to select. Once cascade update is applied, any changes you make to the value of a primary key in the parent table will be "cascaded" to the related foreign key in the child table.

If Jet won't allow you to enforce RI, you will need to clean up your data. Once the orphans are eliminated (it's a cruel world), you can go back and enforce RI.
 

Len Boorman

Back in gainfull employme
Local time
Today, 03:07
Joined
Mar 23, 2000
Messages
1,930
Based on Pat's post it does seem that I mis interpreted your question. My comments were based on actually changing tye primary key not changing the value of a primary key. Sorry if I confused you

Len
 

ssh

Registered User.
Local time
Today, 03:07
Joined
May 22, 2002
Messages
49
Pat's information helped me, thanks!
 

Users who are viewing this thread

Top Bottom