If i was to have a table with an integer column containing n number of rows and wanted to check if they were consecutive, how could I do this?
DECLARE @Temp TABLE
(
IntegerValue INT,
Processed BIT
)
I have a solution that works for 3 rows but this is infelxable, if the requirements change then so would the query (ignoring the fact that my sum wouldnt work in this case).
@SumOfValues = (@FirstValue * @NumOfValues) + @NumOfValues
If you want to know where the gaps are you can use