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.
| Author |
Topic |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2004-08-04 : 12:49:03
|
| How do I generate the incremental number that has both char and int.The max ID from A table is AB1000 and I would like to generate the incremental number after the max ID. For example, AB1000 AB1001 AB1002 . . . . .AB50002 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-08-04 : 12:55:44
|
| store the # portion in a seperate field...or if its always 2 characters at the beginningDeclare @myId varchar(10)Set @myId = 'AB1031'Select newId = left(@myId,2) + convert(varchar(10),convert(int,right(@myId,len(@myId)-2)) + 321)Corey |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|