Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Increment Alpha Numeric
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 03/25/2013 :  21:26:11  Show Profile  Reply with Quote
Need help with in writing a Stored Procedure for Auto Alpha Numeric Generation. If I pass an Alpha numeric in the format mentioned below , I should get next number based on the following logic:

Format : It consists of 6 digit Alpha Numeric Code , where E is constant. For ex : E00001

SP should generate like this:

E00001 to E99999 when it reaches to E99999 then 9 on left will be replaced with "A"- EA0001

EA0001 - EA9999
EB0001 - EB9999
EZ0001 - EZ9999 when it reaches EZ9999 it should be incrmented to E0A001


Yak Posting Veteran

54 Posts

Posted - 03/26/2013 :  00:14:41  Show Profile  Reply with Quote
Have you considered creating a lookup table with all the possible combinations?
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 03/26/2013 :  14:32:06  Show Profile  Reply with Quote

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000