Atomic update statement?
<p>In many cases I need to obtain a unique identifier from a number series in SQL Server. What I have then is a table that contains a number series name, a min value, a max value and the current value.</p>

<pre><code>Series        Min        Max        Current
-------------------------------------------
Testseries    1          999        23
</code></pre>

<p>Now I'd use the <code>UPDATE ... OUTPUT</code> statement to safely increment and output the current value. All other approaches (for example: <code>UPDATE</code> current and then <code>SELECT</code> are bound to cause race conditions sooner or later).</p>

<p>Now I found out there's the following syntax:</p>

<pre><code>DECLARE @newId INT
UPDATE Numberseries
SET
    @newId = Current += 1
WHERE
    Series = '...'
</code></pre>

<p>This would work as at any point I'd only be updating one single row, as <code>Series</code> is the primary key.</p>

<p>My question is: Will this also be an atomic operation like the <code>UPDATE ... OUTPUT</code> statement so that two clients do not get the same value in simultaneous calls?</p>