How can I have two columns in SQL Server auto increment?

前端 未结 3 1343
死守一世寂寞
死守一世寂寞 2021-01-07 06:48

I have two columns in a table of a SQL server DB that I would like to autoincrement when new fields are added. However, Managment Studio wont allow me to set two columns to

3条回答
  •  滥情空心
    2021-01-07 07:39

    You could make the second field a calculated field based on the first.

    Or make an INSERT trigger than programatically generates the value for the second.

提交回复
热议问题