Avatar of Camillia
Camillia
Flag for United States of America asked on

Idea needed; Inserting flags

I got help with a table design last month. It's below.

I can have flags like Reserved, NBX, Catalog.

I created an enum;
public enum OrderFlag
    {
        Reserved = 'R',
        NXX = 'X',
        Catalog = 'C'
    }


When I insert into Main Table, I will insert using OrderFlag.Reserved. In MainTableFlag, I will insert R.

Do I need that FlagTable to hold the description of the flags. Or is that Enum enough.

Better way of doing this?

MainTable
  ID
  other columns
 
MainTableFlag
   ID
   FlagCode
 
FlagTable
   FlagCode
   Description

Open in new window

ASP.NET

Avatar of undefined
Last Comment
nmarun

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
nmarun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Camillia

ASKER
otherwise, it's an ok design? should I keep that FlagTable? This table is like a lookup table but I dont think i need it because i have the Enum in the code..no?
nmarun

The design seems good. Keep the FlagTable just for reference.. later some day when someone looks at the main table and wonder what on earth would 'R' mean.. they'll have something to bank on.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes