SQL Server convert column to an identity column

后端 未结 2 727
礼貌的吻别
礼貌的吻别 2021-01-13 13:51

I am using SQL Server 2008. One int column I used as primary key but not identity column (whose value will be increased by 1 automatically). I want to convert this column to

2条回答
  •  旧巷少年郎
    2021-01-13 14:35

    Go to your table object in object explorer in sql server right click on a table say modify, than click on a field which is primary key that you want to convert to identity, than below you'll see column properties , there you need to change as (Is Identity) Yes and Idendity Increment 1.

提交回复
热议问题