Wednesday, March 28, 2012

How to construct a cell value

My users have decided they want to use an alpha-numeric concatenation
for an identifier in their projects. The DB will use a bigint for a
record number, but I need to construct the value they'll use for their
"human"-readable value.
It'll go like this: A000, A001, A002, A003... B000, B001... AA00, AA01,
etc. Where each place is cycled through the alphabet first then 0-9.
I figure the first 2 places will give them enough project ids to last 10
years or so, but programming this thing needs to plan for longevity and
maintenance.
What is the best way to build this? Regular expressions, pure SQL in a
sproc? I need to have rules to build it appropriately and
systematically. I'll be writing the front ends in C#.NET.
Thanks in advance.
_E
*** Sent via Developersdex http://www.examnotes.net ***Why A001 is more human readable than 1?
Creating that kind of column will stop you from using bulk inserts without
traversing the set to calculate that value.
AMB
"Esteban404" wrote:

> My users have decided they want to use an alpha-numeric concatenation
> for an identifier in their projects. The DB will use a bigint for a
> record number, but I need to construct the value they'll use for their
> "human"-readable value.
> It'll go like this: A000, A001, A002, A003... B000, B001... AA00, AA01,
> etc. Where each place is cycled through the alphabet first then 0-9.
> I figure the first 2 places will give them enough project ids to last 10
> years or so, but programming this thing needs to plan for longevity and
> maintenance.
> What is the best way to build this? Regular expressions, pure SQL in a
> sproc? I need to have rules to build it appropriately and
> systematically. I'll be writing the front ends in C#.NET.
> Thanks in advance.
> _E
> *** Sent via Developersdex http://www.examnotes.net ***
>|||Thanks for the suggestions, Jim, leoinfo y el estimado Sr. Mesa, but this is
a central ID for all applications across multiple locations, so they need to
be unique.
What I've decided to do it use a table of seed values containing the low and
high values along with a "row" identity. I'll do the check in my object code
.
I tried to create a new numbering system, which would have been great, but
they do not want alpha in the places below 1000, i.e. A999 goes to B000, not
to A99A as in a number system. See the last one in the A999 example should b
e
AYYY then it goes to B000. The seed values fix that, but it's a cludge. No
doubt.
I'm sure it'll have at least 15 changes before it's finished, but I think
I've anticipated most of them. I've written some DOD stuff so version and
revision control code already exists that I can modify. I'll just act like
it's a life altering change. :-]
_E
"Jim Underwood" wrote:

> Why not just use the identifier that you already have and let them input a
> human readable description or short description?
> "Esteban404" <esteban> wrote in message
> news:eaB%23cc$VGHA.2040@.TK2MSFTNGP15.phx.gbl...
>
>sql

No comments:

Post a Comment