Indentity Problem – Spanish Forum | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Indentity Problem – Spanish Forum


One member, spanish forum, has the following problem. He insert one table with many rows. That table has identity column.
Each day he delete all rows and insert again using DTS.
SQL begin inserting with the last id after delete. He need to begin with id = 1 each time. Is there any way, beside SET IDENTITY_INSERT table ON each time using DTS? Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
If the table is TRUNCATED with TRUNCATE TABLE… statement then the identity value will start from start again. HTH Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Thanks, this is the solution.
Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
Truncating works faster since it is not logged, however if recovery is a high priority I recommend using delete the applying this command. DBCC CHECKIDENT(MyTable,RESEED,0) which will reset the identity column back to 1 [8D]
Yes, Raulie (ex-Lazy), I allready read your answer in spanish forum, thanks.
Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
]]>