Hi Bent,
If you use TRUNCATE TABLE to delete the records from your table, it will
also reset the identity.
If you use DELETE, you will have to reset the identity to the appropriate
value using the DBCC CHECKIDENT statement.
DBCC CHECKIDENT ('mytable', reseed, newvalue).
If you need to clear all records from your table, use the TRUNCATE
statement.
It is far more efficient than DELETE and produces much less logging.
HTH
[quoted text, click to view] "Bent Lund" <bstlu@online.no> wrote in message
news:uCzeLgGbDHA.1832@TK2MSFTNGP09.phx.gbl...
>
>
> Hello, I am designing a database that communicates with a PLC.
>
> I have a product-log with a primary key of type intgere which is a
> Identity inctr 1.
>
> The PLC kan only read integeres up to 65k. In other words i need to
> reset the Identity before exeeding 65k.
>
> This will not cause duplicates, as the records in this table is deleted
> after the production cycle is completed.
>
> Does the Identity automatically restart at 1, or do i have to handle
> this in the procedures i use for addind data to the table.
>
>
> Regards
>
> Bent
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!