Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get next number from SQL Server
Message
From
20/11/2006 10:03:02
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01171148
Message ID:
01171169
Views:
7
>>In our order entry application, when an order is created, the next available order number is taken from a field in a table. Then, the field is incremented by 1 for the next time this routine is called.
>>
>>We want to use a SQL Server table within our .Net application to manage the next number field. However, how can we lock the table in our routine, while it's getting and incrementing the field, so that no other user can access the table. Then unlock the table when done.
>>
>>We want to avoid two or more users getting the same next number order number from the table's field.
>>
>>How can this be done?
>>
>>Thanks,
>>
>>Jerry
>
>How about using an autoincrementing field? Another thought is to use the uniqueidentifier field type.


Thanks, good point. Yes, I can make the order number field in the order header table an autoincrement. I was trying to duplicate what we currently do with VFP without an autoincrement, but you make a good point.

Thanks,

Jerry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform