Auto-increment column

UDA

Auto-increment column

Do we have feature for auto-increment in Teradata tables? We have teradata 12.
2 REPLIES

Re: Auto-increment column

yes you can define the column as IDENTITY. One code sample is :-

CREATE TABLE dbtest.testtab (
rec_num INTEGER GENERATED ALWAYS AS IDENTITY
(START WITH 1
INCREMENT BY 1
MINVALUE -2147483647
MAXVALUE 2147483647
NO CYCLE),
col2,
...
)

Re: Auto-increment column

Hi,

Thanks for the reply.

Actually we have created a column without auto-increment. Now i want to alter the table to make the column as auto incremented.

i tried alter command to include the code shared by you but it is throwing error.

Please suggest