Reset Identity column in SQL Server

前端 未结 10 938
遥遥无期
遥遥无期 2021-01-18 00:59

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

10条回答
  •  忘掉有多难
    2021-01-18 01:26

    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?)

提交回复
热议问题