how to get the next autoincrement value in sql

后端 未结 10 986
时光取名叫无心
时光取名叫无心 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:55

    For MS SQL 2005 and greater:

    Select Cast(IsNULL(last_value,seed_value) As Int) + Cast(increment_value As Int) As NextID
    From sys.identity_columns
    WHERE NAME = 
    

提交回复
热议问题