Hello there, I know (i think) this can be done (i saw it somewhere, but can't remember where), so maybe you guys can help me.

I need my primary key to have left values on the auto_increment. For example

P20060001
P20060002
P20060003
...

I need to have P2006 values on the left of the primary key, but the primary key needs to keep auto_incrementing. How do I get around this?

thanks so much in advance!

You could have a stored procedure that could take the two and combine them. For instance, if a new one is needed when you incriment combine the two and then store it. I hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.