Can a sql server table have two identity columns?

前端 未结 9 1848
孤城傲影
孤城傲影 2020-11-27 06:23

I need to have one column as the primary key and another to auto increment an order number field. Is this possible?

EDIT: I think I\'ll just use a composite number a

9条回答
  •  情深已故
    2020-11-27 07:01

    The primary key doesn't need to be an identity column.

    You can't have two Identity columns.

    You could get something close to what you want with a trigger...

提交回复
热议问题