I am making an SQL database that stores contacts. I want to be able to delete contacts, and the correct id for each contact is crucial for my software connecting to it. Lets
You're using id's as more than just an identifier. If that's the case, you won't be able to use an auto increment field. You'll need to handle this in your code.
That's not how IDs work, and not how they should work. The ID should never change, or all the linked information would point to the wrong row.
Instead, why not add a "External_ID" column that you control? Or number them dynamically in your query (with a computed column?)
The ID is the unique identifier of the row.
It can be used to link a row to another row in another table. The absence of ID holds information in itself as well, as it would clearly say that it was deleted. Starting to recycle ID numbers defeats completely the purpose of having a unique identifier, and doesn't make any sense really. Once an ID is assigned to a row, you must not arbitrarily change it.
Imagine for a second that when someone dies, they hand over his social insurance number (ID) to someone else. That will result in transferring all the old information that was linked to the dead person's social insurance number to that new person, which doesn't make any sense. Same happens with IDs, if an ID is reassigned, it'll be inheriting any old data that was previously linked to it.
This would be much better solved using another method than renumbering the identity column each time a row is deleted.
Hard to say exactly what else you would do without knowing why your application has this need, but the fact that your application needs this functionality is probably indicative of a design problem somewhere.