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

SQL Server Security: Always Encryption

By

As discussed introduction of Always Encryption blog and initial Encryption at rest as TDE...

SQL Server Security – TDE Encryption

By

Transparent Data Encryption(TDE): TDE was initially introduced in SQL Server 2008 Enterprise Edition; this...

A Las Vegas Break

By

Only a little break for me. I’m actually heading to Las Vegas today for ...

Read the latest Blogs

Forums

The day-to-day pressures of a DBA team, and how we can work smarter with automation and AI

By Terry Jago

Comments posted to this topic are about the item The day-to-day pressures of a...

The Problem Isn't Always Your Query or Schema... Sometimes It's Hidden Assumptions

By dbruton95

Comments posted to this topic are about the item The Problem Isn't Always Your...

Identity Defaults

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Identity Defaults

Visit the forum

Question of the Day

Identity Defaults

What happens when I run this code?

CREATE TABLE dbo.IdentityTest
(
     id int IDENTITY(10) PRIMARY KEY,
     somevalue VARCHAR(20)
)
GO

See possible answers