I'm using SQL Server 2005 and need to figure out how to write a query that will show me missing ID numbers.
The number series is "2000xxx" and I've found a problem with the front end .asp page that's allowing users to skip adding user ids. Anyway, rather than manually look through all of the numbers to find gaps, I'm sure there's some way to find missin sequential numbers in this field. However, the field datatype is varchar(15), so I don't know if that will create problems looking for sequential numbers.
This is a single table where the value is stored, called tPerson, and the field name is PersonID.
Can anyone help?
P.S. I've never written a cursor query, so please provide as much detail as possible.
Thanks!
The number series is "2000xxx" and I've found a problem with the front end .asp page that's allowing users to skip adding user ids. Anyway, rather than manually look through all of the numbers to find gaps, I'm sure there's some way to find missin sequential numbers in this field. However, the field datatype is varchar(15), so I don't know if that will create problems looking for sequential numbers.
This is a single table where the value is stored, called tPerson, and the field name is PersonID.
Can anyone help?
P.S. I've never written a cursor query, so please provide as much detail as possible.
Thanks!