Posted by: U?Me June 9, 2008
SQL Automatic incremental generator
Login in to Rate this Post:     0       ?        
Hey Arnzombie ,
Thanks for your continuous help. I called a meeting to try to understand and solve this issue. On the other hand, let's go back to the original problem I posted (hence the start of this thread). I created this function:

alter function NextCustomerNumber (@id int)
returns char(7)
as
begin
return 'R' + right('000000' + convert(varchar(10), @id), 6)
end

Now, the problem I have is, the number starts wherever it pleases. Instead of starting at C00001, and auto-incrementing by 1, this is just too random. any suggestions?
Read Full Discussion Thread for this article