We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,803 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Leading auto increment value

Hey Guys,

I've got a question that's gotten me stumped.
Granted, i've been away from MySQL and daniweb for well over 18months, i've picked up pretty much where i left off back then, and am just filling in the blanks as i go along.

My question is:
i have a primary key (auto increment) that i want to set as the following format: 2012xxxxx.

so i have a leading value of 2012, and subsequently 5 trailing values (which are to be auto incremented).

To be honest, im not sure if it can be done or not, but im just hoping (as im going to use the values to produce barcodes for customer files later down the track).

Any help would be appreciated.

2
Contributors
2
Replies
59 Minutes
Discussion Span
9 Months Ago
Last Updated
3
Views
Question
Answered
tyson.crouch
Junior Poster
154 posts since Apr 2010
Reputation Points: 16
Solved Threads: 17
Skill Endorsements: 0

ALTER TABLE tablename AUTO_INCREMENT = 201200001

pritaeas
Posting Prodigy
Moderator
9,267 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
Question Answered as of 9 Months Ago by pritaeas

Thank you !

tyson.crouch
Junior Poster
154 posts since Apr 2010
Reputation Points: 16
Solved Threads: 17
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.1437 seconds using 2.66MB