How Do You Tell What Next Identity Column Will Be?

前端 未结 6 1644
遥遥无期
遥遥无期 2020-12-06 19:12

Is there a tsql query to tell what SQL server identity column value it expects to use for the next row insert?

Edited to add:

I deleted and

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 19:39

    Since you seed from 1 and increment by 1 (IDENTITY(1,1)), I'm wondering if you can create a procedure where you can set a variable like "Select @@IDENTITY + 1" or something like that.

提交回复
热议问题