I would like to auto-generate a column which has a mixture of both numbers and alphabets. Like AA01 or AC24. I want to start at AA00 until AA40. From here i will go to AB00 until AB40, and do likewise for other subsequent alphabets until the last one which will be AZ40. I just need a start off. I understand i can make use of the ASCII key but dont really understand how. Any help or suggestion is appreciated. Thank you.
Jump to Post
create table #table ( id varchar(10) ) select * from #table declare @max varchar(10) declare @default varchar(10) declare @newid varchar(10) declare @alphabet char(1) declare @number char(2) select @default = 'AA00' if(exists (select 1 from #table)) begin select @max = max(id) from #table select @newid = 'A' if( …
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.