I HAVE CREATED IDENTITY VALUE FOR COLUMN ID IN TABLE..
IDENTITY(1,1)..
IF I DELETE RECORD ID 11..AND NEW RECORD ..ID IS TAKEN 13 NOT 12..
I USE TO RUN SQL QUERY
DBCC IDENTCHECK('TABLENAME',RESEED, 11)
EVERY TIME..
HOW TO AUTOMATICALLY RESEED COLUMN VLAUE..
Jignesh TrivediPosted Apr 23, 2013, 10:36 AM
hi,
each and every time use DBCC command or turn on /off identity on column is not good idea.
if we turn on / off identity on column on every insert, than Identity doesn't make any sense.
what you think?
Instead of doing this I would suggest use normal column not use identity column. increment value of this column before inserting value.
hope this will help you.
Sandeep MhatrePosted Apr 23, 2013, 8:59 AM
http://sandeepmhatre.blogspot.com/2013/04/insert-data-into-identity-column.html