i have an SQL table thet have a unique key column, this key increases by 1 when i insert a new record , suppose i deleted all records in this table so if i add a record after deleting all records the count will continue and i would get for example an id of 97 for that record,question is is there a way in sql to get that value of 97 before adding a the record?
Share
Yes. Use
IDENT_CURRENT(TABLE_NAME)function to get current identity value of tableTABLE_NAME.