My query here gives me a list of numbers:
select distinct cast(SUBSTRING(docket,7,999) as INT) from [DHI_IL_Stage].[dbo].[Violation] where InsertDataSourceID='40'
and ViolationCounty='Carroll' and SUBSTRING(docket,5,2)='TR' and LEFT(docket,4)='2011'
order by 1
Gives back:
I want to find the numbers missing in the sequence