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 527371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:52:32+00:00 2026-05-13T08:52:32+00:00

There is a table in our database that acts very much like a standard

  • 0

There is a table in our database that acts very much like a standard lookup table (ID, Description). However, this particular one is not static, the client wants the ability to add entries on the fly. Some entries that will come pre-populated are “special” in that there will be code that checks for them (various business rules).

Normally, I’d create the table without auto-incrementing IDs so I can be safe in the knowledge that the enum that mirrors the entries in the table always match. Then it’s just a matter of checking if this object’s ID matches up with the enum value I’m checking for.

I could attempt the same approach, with IDs that don’t auto-increment and an enum that only covers the entries that aren’t added on the fly. We would shortly run into the issue of coming up with the next ID when the user adds a new entry. Basically re-implementing in code the database’s auto-increment feature.

If I switch to using identity columns, there’d be the whole issue of getting out of sync with the enum values.

Of course I could always match on the textual ‘Description’ attribute but that’s bad for obvious reasons.

Is there a nice way to deal with something like this? This question doesn’t really answer it for me.

  • 1 1 Answer
  • 0 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-13T08:52:32+00:00Added an answer on May 13, 2026 at 8:52 am

    In addition to the solutions given here, there is always the possibility to use a completely meaningless identity for all your lookup foreign keys but also have a column which links the lookup to your enum values for business logic:

    lkpTable
    PK Identity
    Description
    FK LogicEnum NULL
    
    lkpLogic
    PK EnumValue
    LogicParamColumns
    

    In this case, the logic is provided and not altered by users. New lookups can even be routed to use any existing logical rules – so you can have different settings which behave the same way as existing hardcoded business rules, but display differently.

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

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer end tag for "param" omitted In HTML-compatible-XHTML, elements that are… May 13, 2026 at 8:34 pm
  • Editorial Team
    Editorial Team added an answer This was the first result from the Bing.com search "programming… May 13, 2026 at 8:34 pm
  • Editorial Team
    Editorial Team added an answer since there is an "r" tag under the question, I… May 13, 2026 at 8:34 pm

Related Questions

I've been told that if I foreign key two tables, that SQL Server will
The table in question is part of a database that a vendor's software uses
So the application we've got calls the API's of all the major carriers (UPS,
I'm having to insert values into a new column in our database but I
Edit : Solved, there was a trigger with a loop on the table (read

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.