Wednesday, March 7, 2012

How about cascade insert and update

I am desgining a new database.
Is it suitable to set the cascade insert and cascade update to the foreign
key constrain?
While this can be done on the application level, or through triggers it is
best to do it through cascading update and deletes. Please refer to
http://support.microsoft.com/default...NoWebContent=1
for more information.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:egYkwM1PGHA.648@.TK2MSFTNGP14.phx.gbl...
>I am desgining a new database.
> Is it suitable to set the cascade insert and cascade update to the foreign
> key constrain?
>
|||"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:egYkwM1PGHA.648@.TK2MSFTNGP14.phx.gbl...
>I am desgining a new database.
> Is it suitable to set the cascade insert and cascade update to the foreign
> key constrain?
>
"Cascade insert" doesn't exist. "Cascade delete" is useful, and you should
use it on foreign keys between related entities, but not on foreign keys to
reference or "lookup" tables. "Cascade updates" should almost never be
used, since they only apply where you are updating a primary key, which you
should almost never do.
David

No comments:

Post a Comment