August 4, 2009 at 9:30 am
How do you create unique identifier such as U82300001 ,U82300002 and U82300003 etc to autogenerate for each row
August 4, 2009 at 9:33 am
You could use an identity column and a calculated column that adds a "U" to the beginning of the number. Will that accomplish what you need?
- 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
August 4, 2009 at 9:36 am
I have to ask why the U is mandatory.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 4, 2009 at 10:04 am
The reason why ,I have to use u is because my supervisor made request for the apppointment number format to start off with U
August 4, 2009 at 10:30 am
I agree with Gus. Your simplest approach is to simply use an identity column and add the "U" when the number is displayed to your supervisor's application. You can easily create a view that will handle this for you, or go with the calculated column Gus suggested.
Alternatively, you might discuss this with your supervisor in advance and see if he can live without the "U". Is it a status flag, or a grouping indicator of some sort? In other words, are you going to have to do increments like this?
U2000300001
U2000300002
U2000300003
.
. ( then start over with )
.
X2000300001
X2000300002
X2000300003
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 5, 2009 at 2:00 am
Ever thought about the datatype "'UNIQUEIDENTIFIER" ?
Wilfred
The best things in life are the simple things
August 5, 2009 at 3:17 am
Wilfred van Dijk (8/5/2009)
Ever thought about the datatype "'UNIQUEIDENTIFIER" ?
The reason why ,I have to use u is because my supervisor made request for the apppointment number format to start off with U
Hello I'm here for my appointment, my appointment number is B5010D2A-F8F9-482B-AC29-C1351ECE52CB :w00t:
August 5, 2009 at 3:29 am
"Let me see ... seems your for an amputation of your left leg?"
"No ?? .... Aha! My appointment is B5010D2A-F8F9-482B-AC29-C1351ECE52C8"
"Oh yes, you're pregnant, let's see how the baby is doing"
:-D;-)
Wilfred
The best things in life are the simple things
August 5, 2009 at 4:06 am
Wilfred van Dijk (8/5/2009)
"Let me see ... seems your for an amputation of your left leg?""No ?? .... Aha! My appointment is B5010D2A-F8F9-482B-AC29-C1351ECE52C8"
"Oh yes, you're pregnant, let's see how the baby is doing"
:-D;-)
My appointment is B5010D2A-F8F9-482B-AC29-C1351ECE52C8
Ah yes sir, the DBA will see you straight away:-)
August 5, 2009 at 6:50 am
No, no, no... B5010D2A-F8F9-482B-AC29-C1351ECE52C8 is my NAME. My friends call me BR-542.
My appointment is 45DF88B8-C798-45DC-8E8D-4898172DB091.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply