How to generate alphanumeric auto increment id in mysql
-
How to generate alphanumeric auto increment id in mysql
-
How to generate alphanumeric auto increment id in mysql
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[^] -
How to generate alphanumeric auto increment id in mysql
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[^]
-
How to generate alphanumeric auto increment id in mysql
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, ..........
-
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, ..........
this didnt work only created a collum for prefix