PC Review


Reply
Thread Tools Rate Thread

Cascade Updates ?

 
 
(PeteCresswell)
Guest
Posts: n/a
 
      7th Nov 2007
Is there any performance-related/technical reason not to just
enable this on all relationships unless there's an explicit
reason not to?
--
PeteCresswell
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVycnkgV2hpdHRsZQ==?=
Guest
Posts: n/a
 
      7th Nov 2007
If you are joining tables with natural primary keys (i.e. the key data has
meaning such as a name), cascade update can save you a lot of grief if, for
example, someone changes their name.

Now if you use artifical primary keys, such as an autonumber with no
"meaning", there really isn't a reason to use cascade update as you should
never have to change the primary key data in the parent table. BTW: I almost
always user autonumbers for the PK.

Cascade Delete? You better be very careful and very sure of the business
rules for that one. Once had to fix a mess where a guy decided to never, ever
do business with a certain customer again and deleted them. Cascade delete
took out all the history of sales for that customer too!
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"(PeteCresswell)" wrote:

> Is there any performance-related/technical reason not to just
> enable this on all relationships unless there's an explicit
> reason not to?
> --
> PeteCresswell
>

 
Reply With Quote
 
(PeteCresswell)
Guest
Posts: n/a
 
      7th Nov 2007
Per Jerry Whittle:
>Now if you use artifical primary keys, such as an autonumber with no
>"meaning", there really isn't a reason to use cascade update as you should
>never have to change the primary key data in the parent table. BTW: I almost
>always user autonumbers for the PK.


That's where I'm coming from except for some lookup tables where
I want an ID value of zero to represent "[NA]".

As in:

tlkpReferenceRateType
-----------------------------------
0 = Unknown
1 = Libor 3-month
2 = Libor 6=month
3 = Fed Fund Target.... and so-forth
-----------------------------------


Where I got caught was copying table values from another app and
deleting unused values - leaving gaps in the sequence.

The gaps got me when I was flipping the data on it's side with a
column for ID#1, a column for ID#2... and so forth. My code was
such that the missing values resulted in empty columns.

No big deal to change: I just enabled cascading updates in all
directions from the lookup table and changed the IDs as
desired...

But the process got me thinking about it and wondering if
cascading updates might be a good SOP when setting up tables in
general.
--
PeteCresswell
 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Nov 2007
"(PeteCresswell)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Per Jerry Whittle:
>>Now if you use artifical primary keys, such as an autonumber with no
>>"meaning", there really isn't a reason to use cascade update as you should
>>never have to change the primary key data in the parent table. BTW: I
>>almost
>>always user autonumbers for the PK.

>
> That's where I'm coming from except for some lookup tables where
> I want an ID value of zero to represent "[NA]".
>
> As in:
>
> tlkpReferenceRateType
> -----------------------------------
> 0 = Unknown
> 1 = Libor 3-month
> 2 = Libor 6=month
> 3 = Fed Fund Target.... and so-forth
> -----------------------------------
>
>
> Where I got caught was copying table values from another app and
> deleting unused values - leaving gaps in the sequence.
>
> The gaps got me when I was flipping the data on it's side with a
> column for ID#1, a column for ID#2... and so forth. My code was
> such that the missing values resulted in empty columns.
>
> No big deal to change: I just enabled cascading updates in all
> directions from the lookup table and changed the IDs as
> desired...
>
> But the process got me thinking about it and wondering if
> cascading updates might be a good SOP when setting up tables in
> general.


Personally, I don't see the point. I've never once set Cascade Update in any
database that I've built.

My belief is that a key is (or should be) a permanent thing and should not
be changed.

You're describing a one-time occurrence. Would you have known to change the
numbers of the IDs you kept?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)



 
Reply With Quote
 
(PeteCresswell)
Guest
Posts: n/a
 
      7th Nov 2007
Per Douglas J. Steele:
>Personally, I don't see the point. I've never once set Cascade Update in any
>database that I've built.


>My belief is that a key is (or should be) a permanent thing and should not
>be changed.


Always seemed to me that if CascadeUpdate were needed, the design
of the DB wasn't sufficiently normal.


>You're describing a one-time occurrence. Would you have known to change the
>numbers of the IDs you kept?


I probably should have thought of that... but I shoulda' thought
of a *lot* of things.... -)

I don't have a lot riding on this. It's more idle speculation
than anything else. Sounds to me like I should continue with
CascadingUpdates=False as my default approach - for the reasons
you've stated plus the normalization thing.
--
PeteCresswell
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascade SQL Wilson Microsoft Access 3 5th Jun 2006 10:58 PM
cascade forms Kon Microsoft Access Forms 0 9th Oct 2005 11:01 AM
Cascade DTP CoMa Freeware 0 5th Feb 2005 08:19 AM
Cascade updates on primary keys.. Aaron Smith Microsoft VB .NET 7 5th Jan 2005 03:54 AM
Cascade updates on primary keys.. Aaron Smith Microsoft ADO .NET 7 5th Jan 2005 03:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 AM.