• So you've essentially saved having to declare and set a value in a variable. But to do so, you've had to run an extra DBCC command.

    It would be interesting to see how the two different approaches compare:

    a) performance-wise against a large table with lots of gaps, and

    b) stability-wise against an active table (i.e, one with many connections).

    Perhaps if I have a few minutes tomorrow I might test...