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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:24:32+00:00 2026-05-14T16:24:32+00:00

Primary key attractiveness I have a boss(and also users) that wants primary key to

  • 0

Primary key attractiveness

I have a boss(and also users) that wants primary key to be sophisticated/smart/attractive control number(sort of like Social Security number, or credit card number format)

I just padded the primary key(in Views) with zeroes to appease their desire to make the control number sophisticated,smart and attractive. But they wanted it as: first 2 digits as client code, then 4 digits as year year, then last 4 digits as transaction number on that client on a given year, then reset the transaction number of client to 1 when next year flows. Each client’s transaction starts with 1. e.g. WM20090001, WM20090002, BB2009001, WM20100001, BB20100001

But as I wanted to make things as simple as possible, I forgo embedding their suggested smartness in primary key, I just keep the primary key auto increments regardless of client and year. But to make it not dull-looking(they really are adamant to make the primary key as smart control number), I made the primary key appears to them smart, on view query, I put the client code and four digit year code on front of the eight-zero padded autoincrement key, i.e. WM200900000001. Sort of slug-like information on autoincremented primary key.

Keeping primary key autoincrement regardless of any other information, we are able keep other potential side effects problem when they edit a record, for example, if they made a mistake of entering the transaction on WM, then they edit the client code to BB, if we use smart primary key, the primary keys of WM customer will have gaps in their control numbers. Or worse yet, instead of letting the control numbers have gaps/holes, the users will request that subsequent records of those gaps should shift up to those gaps and have the subsequent records’ primary keys re-adjusted(decremented).

  • How do you deal with these user requests(reasonable or otherwise)?
  • Do you yield to their request?
  • Or just continue using dumb primary key and explain them the repercussions of having a very smart/sophisticated primary key and educate them the significant advantages of having a dumb primary key?

P.S.

quotable quote( https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-1044961.html ):

“If you hold your tongue the first
time users ask what is for them a
reasonable request, things will work a
lot better in the end.”

  • 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-14T16:24:32+00:00Added an answer on May 14, 2026 at 4:24 pm

    Is there some concatenation of keys that make a natural synthetic unique key? I suppose not or you’d not be asking the question.

    In the same way that your user would not want to know the cylinder/block/head that the record of interest is stored on, they need not know the dumb primary key; it is an implementation detail. There are good reasons for a dumb primary key but they are not business reasons. Hide the implementation detail of dumb keys behind a facade that makes sense at the business level.

    Explaining that they are bikeshedding will probably not work to your advantage. Address the expressed need of the customer, that’s your job.

    • 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 primary key that is auto increment. I want
I have a primary key that I don't want to auto increment (for various
I have a table that has its primary key set to autoincrement. This table
I have a process that needs the Primary Key ID of a newly added
We have a composite primary key for the site table defined below. Functionally, this
I have a primary key set up to auto increment. I am doing multiple
I have three tables A: A.pID primary key, A.Name nvarchar(250) B: B.pID primary key,
I need to update the primary key for a record but it's also the
I have primary key sequence for oracle in my Castle ActiveRecord class: [PrimaryKey(PrimaryKeyType.SeqHiLo, UserId,
I have a primary key auto increment attribute in my table. I want to

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.