Answers for "ON DELETE CASCADE vs ON UPDATE CASCADE"

0

ON DELETE CASCADE vs ON UPDATE CASCADE

/*
It's true that if your primary key is just an identity value auto incremented,
you would have no real use for ON UPDATE CASCADE.

However, let's say that your primary key is a 10 digit UPC bar code and because of 
expansion, you need to change it to a 13-digit UPC bar code. In that case, 
ON UPDATE CASCADE would allow you to change the primary key value and any tables 
that have foreign key references to the value will be changed accordingly.
Posted by: Guest on March-29-2022

Browse Popular Code Answers by Language