how to get the next autoincrement value in sql

后端 未结 10 979
时光取名叫无心
时光取名叫无心 2020-12-16 13:21

I am creating a winform application in c#.and using sql database.

I have one table, employee_master, which has columns like Id, name, address

10条回答
  •  悲&欢浪女
    2020-12-16 13:34

    the max(id) will get you maximum number in the list pf employee_master

    e.g. id = 10, 20, 100 so max will get you 100

    But when you delete the record it must have been not 100

    So you still get 100 back

    One important reason for me to say this might be the issue because you are not using order by id in your query

提交回复
热议问题