I got a solution to the problem (not working):
To get the following auto-increment value from SQLServer:
SELECT IDENT_CURRENT('table_name');
Thus,
SELECT IDENT_CURRENT('table_name')+1;
This will not be violated if the rows are deleted from the table with the identifier, and the key is not consistent.
, .