In a brand new program where space isn\'t really that big a deal, is it better to delete a row or to disable a row by let\'s say a boolean \"Disabled\" and have the program
It depends. (But you guessed that already, I'm sure.)
In practice, the violation of proper usage here is almost always in the direction of deleting.
The main bad consequence of deleting is how often there are dependent records in other tables whose referential integrity is lost when the parent record goes away.
One red herring used to defend deletion (which you've already dealt with properly by dismissing the issue of storage capacity), is expecting that it will make any noticeable difference in query efficiency.
There are too many cases where user or software issues cause someone to need to hit the big "Undo" button; if you delete, you're out of luck (at least without getting special help and aggravating people you'd rather be nice to.)
The terminology I usually use is "Active" and "Inactive".
A few more points to consider (by Totophil):
Data protection legislation might require your organisation under certain circumstances to purge any identifiable information about an individual. The legislation differs from country to country, some pointers:
On the other hand you might be required by law to keep certain information.
There are two additional solutions for this which I have commonly used. I agree with other individuals who have posted that it is really up to the requirements of your data.
You could prevent the user from deleting the record if it will cause referential integrity problems by using foreign key constraints (provided your RDBMS supports that). A few times I have provided a message to the end-user that "You cannot delete this <object> until you disassociate <parent object> with it." This can work as long as you don't anticipate there are a tremendously high number of associations with another other table or tables.
Another approach is to move any disassociated records to be associated with a record that isn't deleted. For example, say you have a course for which 10 separate class times are associated with it. If you delete the course, you could allow to the user to decided if all 10 classes are deleted or if they are associated with a new or existing course.
It's a judgment call, but I have ended up adding "disabled" columns on tables where I previously thought I could just delete row. I'd say most of the time you're safer adding a disabled column. This can get tricky with n:n relations however, so that's something to consider.
It's probably best to add "deleted" column and offer users to undelete or purge deleted items.
If you do use a deleted, visible, isactive, etc column, you can abstract away having to remember to use it by using views.
I am creating a CRUD and i'm facing the same problem.
Solution : The D of CRUD should disable instead of delete.
Problems:
Big Problem