Cascading in sql

One of the options for a foreign key is CASCADE. Your can configure a foreign key such that
modifications of the parent table are cascaded to the child table. For example, when you
delete a customer, SQL Server also deletes all the customer’s associated orders. Cascading
is an extremely bad idea. It is very common to have foreign keys defi ned between all
the tables within a database. If you were to issue a DELETE statement without a WHERE
clause against the wrong table, you could eliminate every row, in every table within your
database, very quickly. By leaving the CASCADE option off for a foreign key, if you attempt
to delete a parent row that is referenced, you get an error.

Advertisements
This entry was posted in Query.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s