T-SQL

External Article

Using DELETE CASCADE Option for Foreign Keys

  • Article

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.

2012-08-13

3,973 reads

Blogs

The end of an era – why I chose not to renew my MVP

By

Two years ago, two things happened within a few days of each other. I...

PowerShell Strikes Back: A New Script

By

This is it. The final chapter of PowerShell Strikes Back. Over the past four...

Claude Desktop

By

Claude is more than a chat window. The desktop experience includes structured workspaces, generated...

Read the latest Blogs

Forums

Unraveling the Mysteries of the Ephemeral Model: The Fabric Modern Data Platform

By John Miner

Comments posted to this topic are about the item Unraveling the Mysteries of the...

QUOTENAME Behavior

By Steve Jones - SSC Editor

Comments posted to this topic are about the item QUOTENAME Behavior

Running script without having permission to Function

By Reh23

Good Morning. I have a T-SQL Script which has been developed to execute a...

Visit the forum

Question of the Day

QUOTENAME Behavior

I use QUOTENAME() like this in code?

DECLARE @s VARCHAR(20) = 'Steve Jones'
SELECT QUOTENAME(@s, '>')
What is returned?

See possible answers