Listing 1: Code That Retrieves the Clustered Identity Key's MAX and MIN Values SELECT @max_value = MAX(identity_column), @min_value = MIN(identity_column) FROM large_table WHERE location = @location AND some_date_time BETWEEN @start AND @end