August 26, 2008 at 11:21 pm
Hi,
I'm new to sql server.
if anybody has a script to auto-generate alphanumeric like
AAA1000
AAA1001
AAB1002
etc..
Thanks in advance,
August 26, 2008 at 11:27 pm
It's not hard to do, but you are going to have to define the sequence that you want better.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
August 27, 2008 at 1:13 am
say the first few either 3 or five are characters and the rest are numeric. and increasing and this will be the primary key for the table
-viji
August 27, 2008 at 7:28 am
deviji2000 (8/27/2008)
say the first few either 3 or five are characters
Alphabetic(A-Z) characters or Alphanumeric(0-9,A-Z)?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
August 27, 2008 at 7:46 am
The rules for incrementing need to be defined.
What condition causes AAA1001 to increase to AAB1002? The number part, in your example, seems to go up by one each row. That part is easy. What causes the letter part to go up? That's not clear from the example you gave.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply