SQL Server, How to set auto increment after creating a table without data loss?

后端 未结 7 1713
天涯浪人
天涯浪人 2020-11-22 09:54

I have a table table1 in SQL server 2008 and it has records in it.

I want the primary key table1_Sno column to be an auto-incrementing col

7条回答
  •  迷失自我
    2020-11-22 10:22

    Yes, you can. Go to Tools > Designers > Table and Designers and uncheck "Prevent Saving Changes That Prevent Table Recreation".

提交回复
热议问题