In SQL Server or maybe other databases, if a column is auto increment int type, the table can remember the highest value even if the record has been deleted.Let’s say you have a table whose with some records previously deleted, and then you use SELECT MAX([ColumnName]), it might return a value associated with a deleted record. Has anyone seen scenarios like this?
Share
This will not happen with
SELECT MAX(as can be seen from the below script) in Sql Server.Output
If you were looking for the Tables Identity Value, see @AdaTheDev answer.