Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. How to generate alphanumeric auto increment id in mysql

How to generate alphanumeric auto increment id in mysql

Scheduled Pinned Locked Moved Web Development
mysqltutorial
5 Posts 5 Posters 45 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deepthi 21456
    wrote on last edited by
    #1

    How to generate alphanumeric auto increment id in mysql

    K S Z 3 Replies Last reply
    0
    • D Deepthi 21456

      How to generate alphanumeric auto increment id in mysql

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      Hi, We have a forum for MySql Problems, I suggest you move your post here[^] Regards, Keith

      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
      -Or-
      A Dead ringer for Kate Winslett[^]

      1 Reply Last reply
      0
      • D Deepthi 21456

        How to generate alphanumeric auto increment id in mysql

        S Offline
        S Offline
        Sandeep Mewara
        wrote on last edited by
        #3

        Have a look at this article: Auto Generate AlphaNumeric ID’s in a SQL Server Table[^] - It's for SQL Server but the around it remains the same.

        Sandeep Mewara Microsoft ASP.NET MVP [My latest Article]: Server side Delimiters in ASP.NET[^]

        1 Reply Last reply
        0
        • D Deepthi 21456

          How to generate alphanumeric auto increment id in mysql

          Z Offline
          Z Offline
          Zamshed Farhan
          wrote on last edited by
          #4

          You have to store the key as two columns. A char prefix and an auto-incrementing int, both of which are grouped for the primary key. CREATE TABLE my_table( id INT NOT NULL AUTO_INCREMENT, prefix CHAR(30) NOT NULL, PRIMARY KEY (id, prefix), ... Say, prefix is here 'PRF', then you get PRF1, PRF2, PRF3, ..........

          C 1 Reply Last reply
          0
          • Z Zamshed Farhan

            You have to store the key as two columns. A char prefix and an auto-incrementing int, both of which are grouped for the primary key. CREATE TABLE my_table( id INT NOT NULL AUTO_INCREMENT, prefix CHAR(30) NOT NULL, PRIMARY KEY (id, prefix), ... Say, prefix is here 'PRF', then you get PRF1, PRF2, PRF3, ..........

            C Offline
            C Offline
            Chioma Owuama
            wrote on last edited by
            #5

            this didnt work only created a collum for prefix

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups