>>>>>If this is not your PK, why not change your data to be stored in that format as a string to begin with? you can still make it unique.
>>>>
>>>>That would be ideal, but I was having great difficulty working out how to get the next number. I think somebody had mentioned a way to do this before, but I can't find any reference to it again.
>>>
>>>That would be pretty easy to implement and I bet it wouldn't matter that much if a value got skipped occasionally. I did that with a permit system years ago and the only time a value would get skipped normally is if two are being added at the same time and one got canceled. My way put numbers back into a stack if they got canceled and then could get re-used. Lost of ways to do it. You could store it as a fixed length that way with leading zeros if you wanted. Or alpha if you wanted.
>>>Tim
>>
>>Can you provide some more detail on how to work it? Normally in VFP I have a table with the last number used, lock the record, increment it and unlock it. How can this work in SQL Server or should it all be done in .NET?
>
>
>Seems like I had sent this to you once before. I did this back in the 80's and it is a bit primitive. I can send you that again with some explanation of how I did it. You most likely could come up with a more modern way to do this maybe with using my example as a brainstorm.
>Tim
I wouldn't be surprised. I know a couple people sent me some info on this, but I couldn't find it when I went back through my old emails. That's when I decided I'd look again at using the Identity field. My logic being if it's there already in SQL Server why re-invent.
I look forward to getting the stuff from you again.
Thanks
Thanks