Answer by Oleg
I can offer a solution at the risk of embarassing myself (just cannot come up with anything simpler). The idea is that joining the table with itself based on the previous row match and the next row...
View ArticleAnswer by WilliamD
You didn't mention what version of SQL Server. This will work on 2005 and onwards. Here you go: ---------- ## EDIT: 27.04.11 10:00 ## Fixed the false positives in the sequence detection as described by...
View ArticleAnswer by Phil Factor
I've come a bit late to this party. This code seems to work fine in 2005 and 2008. DECLARE @SequenceNumber INT, @PreviousNumber NUMERIC(18) DECLARE @table TABLE (ID NUMERIC(18) PRIMARY KEY IDENTITY(1,...
View Article
More Pages to Explore .....