Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Duplicate Key / Invalid last row identity value (0)
Fri, Sep 7 2018 10:38 AMPermanent Link

Charalampos Michael

Hello,
 I have a table filled with data and i change the "recordid" to be generated by EDB. (i previously made my own generated integer keys)
 Now if i append a record i get a "duplicate key" error "0" so i have to repair the table in order EDB to fix the LastAutoInc value. (My point is that EDB should Set the correct LastAutoInc value when altering the field)

Thank you
 
Fri, Sep 7 2018 10:49 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Hello,

If the column is populated with the old integer values, you have to tell EDB where to start from now on :

ALTER TABLE <TableName> ALTER COLUMN <ColumnName> RESTART WITH <SeedValue>

--
Fernando Dias
[Team Elevate]
Sun, Sep 9 2018 3:43 AMPermanent Link

Charalampos Michael

Fernando,

<< If the column is populated with the old integer values, you have to tell EDB where to start from now on :

ALTER TABLE <TableName> ALTER COLUMN <ColumnName> RESTART WITH <SeedValue> >>

Well, my point was EDB should do that automatically.

Thank you
Sun, Sep 9 2018 10:12 PMPermanent Link

Raul

Team Elevate Team Elevate

On 9/9/2018 3:43 AM, Charalampos Michael wrote:
> Well, my point was EDB should do that automatically.

I disagree - otherwise one could not do alter without resetting seed
value each time.

Raul
Mon, Sep 10 2018 4:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< I have a table filled with data and i change the "recordid" to be generated by EDB. (i previously made my own generated integer keys)
 Now if i append a record i get a "duplicate key" error "0" so i have to repair the table in order EDB to fix the LastAutoInc value. (My point is that EDB should Set the correct LastAutoInc value when altering the field) >>

This FAQ explains the rationale for why it works the way that it does:

https://www.elevatesoft.com/supportfaq?action=view&category=edb&question=altering_identity_seed_value

Tim Young
Elevate Software
www.elevatesoft.com
Image