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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Increment char + numbers

Author  Topic 

shangar78
Starting Member

1 Post

Posted - 2009-06-07 : 10:16:08
Hi

I want to increment char + number like PO000000000001(increment by 1 like PO000000000002).

currently i'm doing like this

get the substring the char part PO and fine len to other part & cast it then increment by on , after increment find the len again the add zeros again.

it the very long way.

is there any proper good way to increment char + number


Thanks

shangar

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-07 : 11:03:36
This is interesting to you:
http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -