It may require some time to know what will be our identity value before we actually insert record in our table. Usually we tend to find our max id value by selecting max id from records. But it may be possible you deleted records and now you want to know next identity value. SQL server has given a very nice function for it.
SELECT IDENT_CURRENT(‘mytable’)
In above line, mytable is table name, in which we want to find next identity value. Very impressive function!!
No comments:
Post a Comment