I'm trying to create syntax that will allow me to find the max customer ID from the customer table and then add 1 onto it so that it is completely unique. I would like this to be generated automatically into my add customer form, any ideas?
How to generate a unique customer ID?
Collapse
X
-
-
I would use an autonumber for this. You cannot be absolutely sure that finding this max customer ID from a table and then adding 1 to it will be unique in a multiuser environment.
If you DB isn't in a multiuser environment then I would still use autonumber because it is just plain easier. Why solve a problem that microsoft has already solved for you. -
I understand that this would work yes, but in my exam I am given data sets which start from a high number, so if I did autonumber they would reset to 1, 2, 3 and so on when I really need to find the max that they have given me and then I need to add 1 on so that its unique if you understand.
Thanks.Comment
Comment