SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Content with tags T-SQL, Cascade Deletes Rss

   Items 1 to 2 of 2   


By Igor Micev 2015/03/24 | Category: foreign keys (fk)
Rating: (not yet rated) |  Discuss |   Briefcase | 2,179 reads

Using DELETE CASCADE Option for Foreign Keys

Referential integrity is a very important thing to consider when designing a database. In my years as a DBA I've seen database designs that sit on both ends of the spectrum, none at all and cases where every table is linked to multiple tables. While the later certainly can be a little more difficult to work with it ensures the integrity of your data stays intact. The other end provides much more flexibility when it comes to updating and deleting data from your database, whether it's being done through the application or directly on the backend, but has the issue of possible orphan records if things are not done properly. This tip will look at the DELETE CASCADE option when creating foreign key constraints and how it helps keep the referential integrity of your database intact.  Read more...
By Additional Articles 2012/08/13 | Source: MSSQLTips.com | Category: t-sql
Rating:  Rate this |   Briefcase | 3,878 reads
   Items 1 to 2 of 2   
foreign keys (fk) (2)