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

  • Home
  • SEARCH
  • 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 8966069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:56:46+00:00 2026-06-15T16:56:46+00:00

I have 2 id columns: one is the table/system id, which has no meaning

  • 0

I have 2 id columns: one is the table/system id, which has no meaning and should always be auto incremented. The second one is a business ID, which NOT ALWAYS will be set a value on insert, and may be set an incrementing number anytime after Insert.

So I was planning on using the NO_AUTO_VALUE_ON_ZERO setting, but from what I’ve read InnoDB doesn’t support 2 auto_increment columns. Any workaround I can use here?

  • 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-06-15T16:56:47+00:00Added an answer on June 15, 2026 at 4:56 pm

    You can’t have 2 auto-increment in one table or 2 TIMESTAMP column with CURRENT_TIMESTAMP,

    your options:

    • Is to create a trigger.
    • redesign your DB, because if you need to have 2 auto_increment not null, that means that you will have 2 unique keys not null (PK) in that table, which it’s not good.

    How to create a trigger: http://dev.mysql.com/doc/refman/5.1/de/create-trigger.html

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

Sidebar

Related Questions

i have a mysql db, and i have one table which has many columns
I have a table that has two datetime columns (one for start time and
I have one database table which contains 8 columns. One of the columns is
I have a database with many tables and one particular table has columns: name
Is it a bad thing to have two xml columns in one table? +
i have day, month, year, value columns in one table, here i need to
I have a table that containts a set of columns one of it is
I have one datatable. In that table I have columns named [Total Day], [Present
I have a table with two columns and one row, and 100% width across
I have a table with few columns and one of the column is DockNumber.

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.