FKs on all tables for status colunm
Posted
by
Jonarch
on Stack Overflow
See other posts from Stack Overflow
or by Jonarch
Published on 2011-01-02T05:12:34Z
Indexed on
2011/01/02
5:54 UTC
Read the original article
Hit count: 176
I have a colunm "Status" in every table in my DB. The purpose of it is to show if the given row is in use or if it has been deactivated. So values can be (0=deactive and 1= active). Two ways I see this: I can have enums or I am thinking if it is better to keep this colunm as a FK which references the main system data dictionary table which has all the codes used on the system. (website)
The benefit is every table, every row can then be centralized through this FK. So if i ever want to check all rows which are deactive on my system i can from this table as all th child tables will have like status = ID 233, where 233 = deactive in the data dictionary table.
Any benefit or should i stick with the old way of enums?. Also I am thinking if i need one more status for deleted or is that same as deactivated?
© Stack Overflow or respective owner