>If this is not your PK, why not change your data to be stored in that format as a string to begin with? you can still make it unique.
That would be ideal, but I was having great difficulty working out how to get the next number. I think somebody had mentioned a way to do this before, but I can't find any reference to it again.