[dba-SQLServer] Another one on checkident

Francisco Tapia fhtapia at gmail.com
Fri Jul 18 16:11:51 CDT 2008


CheckIndent only returns the last identity value, it does not tell you if
the value is still in the table, just the last one hence you can use
CheckIndent to reseed a table and start the seed at let's say 5mil
5,000,000. otherwise it's the current id value case in point... you have two
users who insert a record into your table, however let's say the 2nd insert
occurred before your program ran the checkIndent, then you'll end up with
the 2nd users' Identity value instead of the one you were really after,
yours.  To solve this issue I always use scope_identity, but even that will
not tell you that the record has been deleted.

On Thu, Jul 17, 2008 at 6:04 PM, Susan Harkins <ssharkins at gmail.com> wrote:

> If you delete the last identity value and run checkident, it says the
> current column value is actually the value you just deleted. Is it supposed
> to do that?
>
> Susan H.
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


-- 
-Francisco
http://sqlthis.blogspot.com | Tsql and More...



More information about the dba-SQLServer mailing list