UPDATE MyTable
SET ID = Select LEFT(REPLACE(REPLACE(REPLA
But the keys will have numbers. if you do not want it you can use replace to get rid of numbers as well.
P.
Hello,
I have a table with two columns (RecordName, Id). I'm trying to create an 8 Character ID unqiue for each record using the characters A-Z (except for the letters L,O,I). The characters will need to be random and unique (the Ids should be executed using a stored procedure).
I'm not sure if I can create an array and loop through it for each record...
Does anyone have any suggestions?
I started by creating a temp table with the letters in there, but then I wasn't sure how to do the rest or if it should be done differently. I would appreciate the input.
Thanks,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The characters that are created represent projects for studies in-house which this id will be later incoporated into Other project Ids. I need to make sure that the ID created is 8 characters in lenght and is combination of letters A-Z except for L,O and I. Each record must have these unique strand of characters.
passandhu, I tried your code and I got an error:
Incorrect Syntax near the Keyword 'Select'.
the user will be able to request this for only certain records, but I wanted to make sure that i can create this strand of characters before moving to the next phase.
I would appreciate the assistance thx.
UPDATE MyTable
SET ID =
REPLACE(REPLACE(REPLACE(RE
Alright so this will do what you are looking for.
Hope this helps.
P.
Here wrap this is in a function:
Declare @T table (C tinyint)
Declare @C tinyint,
@Value varchar(8)
SET @C = 48
While @C <= 90
Begin
IF (@C BETWEEN 48 AND 57 Or @C BETWEEN 65 And 90) And @C Not In (73, 76, 79)
INSERT @T (C) Values (@C)
SET @C = @C + 1
END
Set @Value = ''
Select TOP 8
@Value = @Value + CHAR(C)
FROM @T
ORDER By
NEWID()
Select @Value
>>Would you be able to just explain to me what is happening in the syntax... just for my own benefits.<<
First of all I was not entirely serious when I posted that. I do not believe that T-SQL it the right place to do that. That is entirely a presentation layer problem that is best addressed with something like .NET.
But to answer your question here is what it does:
1. Inserts into a table all the valid values.
2. Picks 8 values at random ( NEWID() )
3. Concatenates them into a string.
Business Accounts
Answer for Membership
by: aneeshattingalPosted on 2009-07-21 at 12:09:41ID: 24908122
Why do u need a character Unique id, you can use uniqueidentifier column
select newId () always gives you unique values