Skip to main content
Tweeted twitter.com/StackDBAs/status/716040267791527936
Incorporated comment
Source Link
Paul White
  • 90.2k
  • 30
  • 423
  • 663

Soft ON (SOFT) DELETE CASCADE

Can't seem to find the right answer for my question so here it goes:

I am familiar with the ON DELETE CASCADEON DELETE CASCADE method, but, I don't want to do a real delete, just a soft delete. This is implemented with a column named isDeleted (0/1).

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

Thanks in advance :)

(this is for MSSQL Server btw)

EDIT: I am thinking: that what I am doing is in fact an update. So I'd be using a ON UPDATE CASCADEan ON UPDATE CASCADE, but will that update the same columns on the FKs? or just the primary key?

ON (SOFT) DELETE CASCADE

Can't seem to find the right answer for my question so here it goes:

I am familiar with the ON DELETE CASCADE method, but, I don't want to do a real delete, just a soft delete.

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

Thanks in advance :)

(this is for MSSQL Server btw)

EDIT: I am thinking: that what I am doing is in fact an update. So I'd be using a ON UPDATE CASCADE, but will that update the same columns on the FKs? or just the primary key?

Soft ON DELETE CASCADE

I am familiar with the ON DELETE CASCADE method, but I don't want to do a real delete, just a soft delete. This is implemented with a column named isDeleted (0/1).

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

I am thinking that what I am doing is in fact an update. So I'd be using an ON UPDATE CASCADE, but will that update the same columns on the FKs? or just the primary key?

added 179 characters in body
Source Link

Can't seem to find the right answer for my question so here it goes:

I am familiar with the ON DELETE CASCADE method, but, I don't want to do a real delete, just a soft delete.

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

Thanks in advance :)

(this is for MSSQL Server btw)

EDIT: I am thinking: that what I am doing is in fact an update. So I'd be using a ON UPDATE CASCADE, but will that update the same columns on the FKs? or just the primary key?

Can't seem to find the right answer for my question so here it goes:

I am familiar with the ON DELETE CASCADE method, but, I don't want to do a real delete, just a soft delete.

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

Thanks in advance :)

(this is for MSSQL Server btw)

Can't seem to find the right answer for my question so here it goes:

I am familiar with the ON DELETE CASCADE method, but, I don't want to do a real delete, just a soft delete.

Is there a way for me to cascade this soft delete from a parent to a child? A built in command? or is up to me to write the code?

Thanks in advance :)

(this is for MSSQL Server btw)

EDIT: I am thinking: that what I am doing is in fact an update. So I'd be using a ON UPDATE CASCADE, but will that update the same columns on the FKs? or just the primary key?

edited tags
Link
user1822
user1822
Source Link
Loading