One of the ways I've seen this done is by creating a table mapping the location to the next ID.
CREATE TABLE LocationID {
Location varchar(32) PRIMARY KEY,
NextID int DEFAULT(1)
}
Inside your stored procedure you can do an update and grab the current value while also incrementing the value:
...
UPDATE LocationID SET @nextID = NextID, NextID = NextID + 1 WHERE Location = @Location
...
The above may not be very portable and you may end up getting the incremented value instead of the current one. You can adjust the default for the column as desired.
Another thing to be cautious of is how often you'll be hitting this and if you're going to hit it from another stored procedure, or from application code. If it's from another stored procedure, then one at a time is probably fine. If you're going to hit it from application code, you might be better off grabbing a range of values and then doling them out to your application one by one and then grabbing another range. This could leave gaps in your sequence if the application goes down while it still has a half allocated block.