How to insert multiple records and get the identity value?

前端 未结 7 772
暗喜
暗喜 2020-11-27 03:54

I\'m inserting multiple records into a table A from another table B. Is there a way to get the identity value of table A record and update table b record with out doing a cu

7条回答
  •  没有蜡笔的小新
    2020-11-27 04:29

    You can get the by joining on the row number. This is possible because since it's an identity, it will just increment as you add items, which will be in the order that you are selecting them.

提交回复
热议问题