Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Problem with generated identity...
Sun, Apr 27 2008 3:58 AMPermanent Link

Uli Becker
I have a table with about 300 000 records. There is an identityfield =
integer which is populated by code.
Now I want to alter the column by a generated integer field.

I set Generated = true, ByDefaultOnly = true, SeedValue = 299298,
Increment = 1.

When trying to insert a new record (in EDBManager) the ID is set to 1
and there is a key-violation off course.

Obviously this only happens when adding the generation belatedly. With a
new table the seedvalue works.

What can I do? (I am not able to delete the field and recreate it
because it's a foreign key).

Thanks Uli
Sun, Apr 27 2008 6:57 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Uli,

What version of EDB are you using, what is the current max value for the
identity column ?

--
Fernando Dias
[Team Elevate]
Sun, Apr 27 2008 7:29 AMPermanent Link

Uli Becker
Fernando,

> What version of EDB are you using, what is the current max value for the
> identity column ?

I am using the latest Version 1.09 B3, the current max value is 299298.

Regards Uli
Sun, Apr 27 2008 9:46 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Uli,

> I am using the latest Version 1.09 B3, the current max value is 299298.

Then, you may try this:
ALTER TABLE <TableName> ALTER COLUMN <ColName> RESTART WITH 299298



--
Fernando Dias
[Team Elevate]
Sun, Apr 27 2008 10:26 AMPermanent Link

Uli Becker
Fernando,

> Then, you may try this:
> ALTER TABLE <TableName> ALTER COLUMN <ColName> RESTART WITH 299298

Thanks a lot, that did the job.

Regards Uli
Image