Problems with IDENTITY_INSERT Set to OFF? :-/

后端 未结 6 832
情深已故
情深已故 2020-12-14 13:49

I\'m trying to insert order details into my DB, and it keeps saying:

Cannot insert explicit value for identity column in table \'Orders\' when IDENTIT

6条回答
  •  不思量自难忘°
    2020-12-14 14:33

    You do not want the UserID to be an Identity, and I also do not think you want the UserID to be the primary key either. More than likely, you want the OrderID to be the primary key, or at best shared primary key with the userid and orderid.

提交回复
热议问题