Setting Identity to on or off in SQL server

后端 未结 4 1328
情深已故
情深已故 2021-02-12 18:26

I want to set Is Identity property of a column to off and after inserting an explicit value setting it to on again.I\'ve written this query :

SET IDENTITY_INSERT         


        
4条回答
  •  暖寄归人
    2021-02-12 19:02

    The session that sets SET IDENTITY_INSERT is allowed to enter explicit values.

    But the column is still an identity column. It's just that your session can ignore the identity constraint.

提交回复
热议问题