RE: Problem with Variables. SQL Server 2000
Personally, I do prefer (and use) the 'single-update' method to increment and return the next countervalue in one go. It makes it unnecessary to wrap in explicit transactions and such. It's physically impossible for the server to return the same counter to more than one caller.update counterTable set @nextid = nextId = nextId + 1 […]
2005-04-20