How do I add auto_increment to a column in SQL Server 2008

前端 未结 5 791
走了就别回头了
走了就别回头了 2021-01-12 21:10

I am using SQL Server 2008 and a primary key of a database table I am using is not an IDENTITY column (not sure why). I need to change that.

I am in SQ

5条回答
  •  醉梦人生
    2021-01-12 21:34

    Remove the default constraint of column Trans_ID first. Then you can set Is Identity to Yes in the designer.

    This is properties for column Trans_ID in your table AR_Transactions. (Is Identity) is disabled:

    enter image description here

    Remove the default constraint and (Is Identity) is no longer disabled:

    enter image description here

    Set to yes and save. Default Value or Binding is disabled instead:

    enter image description here

提交回复
热议问题