How to get the primary key of the last row inserted into the table

后端 未结 2 1878
臣服心动
臣服心动 2020-12-12 03:14

I am using multiview index to insert the news details. In the first view the user can enter details of news which is then inserted into db on clicking the next button the se

2条回答
  •  旧时难觅i
    2020-12-12 04:05

    As part of your INSERT statement (into the first News table), after it runs, execute

    SELECT SCOPE_IDENTITY()
    

    and return NewsId value to caller.

    Ref.

提交回复
热议问题