SQL Server how to drop identity from a column

前端 未结 3 1724
予麋鹿
予麋鹿 2020-12-08 01:18

Is there an easy way to remove an identity from a table in SQL Server 2005?

When I use Management Studio, it generates a script that creates a mirror table without

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 02:02

    You could add a column to the table that is not an identity column, copy the data, drop the original column, and rename the new column to the old column and recreate the indexes.

    Here is a link that shows an example. Still not a simple alter, but it is certainly better than 5231 lines.

提交回复
热议问题