This is for a RIA Services application:
We have an entity A
that looks like:
ID int (PK, identity)
Code string
The Code
consists of a two character prefix AB
, a second two character prefix CD
then a four digit integer. When the entity is added to the database, the user should input ABCD
as the code, and the application should append the smallest possible integer to the code, that has not already been used in another code with the AB
prefix. For example, if the db looks like:
ABCD0001
ABCD0002
ABEF0003
CDEF0001
and the user inputs the prefixes ABGH
, the code should be ABGH0004
.
There will be multiple people using this application simultaneously so I don't think anything Cient-Side is a great option. Any thoughts?
Thanks!