1. Consider our table having some row. Now we are deleting the table with query
DELETE FROM table_name DBCC CHECKIDENT ('table_name', RESEED, 0)The table will generate an identity value form 1 and not from 0.
2. Now we are truncating the table with TRUNCATE TABLE Statement.
TRUNCATE TABLE table_name DBCC CHECKIDENT ('table_name', RESEED, 0)The table will generate an identity value form 0.
During INSERT if there is an error, the row will not Inserted but the Identity value increased according to(IDENT_INCR) the Increment.
No comments:
Post a Comment