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
 ALLOCATE A UNIQUE CODE?

Author  Topic 

Rheinhardt
Yak Posting Veteran

66 Posts

Posted - 2009-04-07 : 08:15:12
hI,

i WANT TO ALLOCATE A UNIQUE CODE TO EACH DISTINCT VALUE IN A NEW COLUMN...

I HAVE THE FOLLOWING COLUMN:

COLB
HATS
SHIRTS
SHOES

AND WANT TO AD A COLUMNA :

COLA COLB
S-1 HATS
S-2 SHIRTS
S-3 SHOES

SO I WANTM TO AD A 'S-' AND A UNIQUE NUMBER.

THANKS

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-07 : 08:17:18
See http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-07 : 08:25:55
Also Refer this

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=57069


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -