I need to read and increment a value atomically in SQL Server 2008, using c#.
For example, I have to insert items of a "lot", for this i need the number of the last lot and be sure, that no one else get this number.
So i have a table only with the last lot number, and find a way to get and update the number in only one step.
How can i do this?