Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 827571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:35:47+00:00 2026-05-15T03:35:47+00:00

Sometimes you want to mark a DB table record as deleted instead of deleting

  • 0

Sometimes you want to mark a DB table record as deleted instead of deleting it permanently, right?

How do you do that?

So far I’ve been using a boolean “deleted” field but I’m not sure if it’s a good apprach.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:35:47+00:00Added an answer on May 15, 2026 at 3:35 am

    That’s about it – a boolean field to indicate that the record is deleted. The few times I used that, I called that field IsDeleted.

    This is often referred to as Logical Delete.

    It’s up to you to respect that field in your reports – which means excluding all the records with IsDeleted = true. Those queries can get a little complicated if you have a lot of tables and relations.

    Also, you may encounter some problems if you have unique constraints on a table. For example, if in a user table a user has IsDeleted = true and the email column is unique, i would not be possible to add a new user with same email address.

    There are some ORM which take those fields into consideration – for example, SubSonic 2.2 will not delete a record if there is a column named ‘Deleted’ or ‘IsDeleted’, instead it will set this field to true.

    Some related resources:

    • Physical vs. logical / soft delete of database record?
    • Should I delete or disable a row in a relational database?
    • Working with SubSonic 'deleted' rows
    • ORM & Logical Delete

    As an alternative to this you could add auditing tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a BLOB field that I sometimes want to set
When using implicit waits, as advised here , I still sometimes want to assert
Sometimes I want to return the value that is a property of an object
I know that Java have its own garbage collection, but sometimes I want to
sometimes when i want a winforms control to be docked also to the right
While using Vim I'll sometimes want to look at a function definition or a
I have a large amount of highly connected nodes that I sometimes want removed
Sometimes I want to search and replace in Vim using the s/search_for/replace_with/options format, but
Sometimes I want to just verify that a function was called rather than have
If I'm not online, I sometimes want to package some changes to a commit,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.