I would like to create an incrementing alphanumeric sequence for a SQL server table, that uses numbers 0-9, lowercase letters a-z, and uppercase letters A-Z. So the series would be like 0, 1, 2, 3...9, a, b, c, d..., x, y, z, A, B, C, D...X, Y, Z and then beyond that it would become 11, 12, 13... 1a, 1b, 1c... 1X, 1Y, 1Z, then 21, 22, 23... 2A, 2B, and so on.
The goal is to have an incrementing string ID that is short in characters, essentially incrementing using a base 62 alphanumeric system.
My first inclination is to create a table with many columns, and each column would store a place in the system. So columns like 0,0,0,0,0,1; and each time a new value was needed it would loop through the columns, incrementing as needed, eventually reaching something like 0,0,0,3,D,z, and so on.
Does anyone have a more clever or concise idea on how to do this? Again, the goal is to create an incrementing sequence that is "short" in terms of the number of places or characters it takes to represent.
Credit to @JohnCappelletti and Daniel Ballinger for the answer found here: http://www.fishofprey.com/2011/08/convert-between-base-10-and-base-62-in.html
To document:
Convert from Base 10 to Base 62 in T-SQL
Convert from Base 62 to Base 10 in T-SQL