Is there a way to SELECT and UPDATE rows at the same time?

后端 未结 9 1536
醉话见心
醉话见心 2020-12-12 21:01

I\'d like to update a set of rows based on a simple criteria and get the list of PKs that were changed. I thought I could just do something like this but am worried about po

9条回答
  •  悲&欢浪女
    2020-12-12 21:29

    It'd be easier to do your UPDATE first and then run 'SELECT ID FROM INSERTED'.

    Take a look at SQL Tips for more info and examples.

提交回复
热议问题