SQL-How to Insert Row Without Auto incrementing a ID Column?

后端 未结 4 683
长发绾君心
长发绾君心 2020-12-24 12:17

I have a table that has a forced auto increment column and this column is a very valuable ID that is retained through out the entire app. Sorry to say it was poor developme

4条回答
  •  悲&欢浪女
    2020-12-24 12:55

    Actually, the code above for INDENTITY_INSERT is correct - turning it ON tells the server you want to insert the values yourself. It allows you to insert values into an IDENTITY column. You then want to turn it back off (allowing the server to generate and insert the values) when you are done.

提交回复
热议问题