explicite value for Auto Inc. columns

Database

explicite value for Auto Inc. columns

I have a table which contain Identity Columns ,

Now I want to copy data from table1 to table2 and need to keep the same Identiy values. as It is used in F. Key  relation

 

I have to be able to explicity set value for the Identity column.

 

In SQL server , I can stop\resum Identity feature on a column with 

set Identity_insert on\OFF

 

Is this cabability exist in teradata ?

,

Is there a way to set a column as auto generated When the table already contain some rows ?

 

 

 

1 REPLY
Teradata Employee

Re: explicite value for Auto Inc. columns

No. In Teradata, you cannot add the IDENTITY attribute to a column after the table has been created, nor temporarily disable GENERATED ALWAYS behavior. (You can permanently remove the IDENTITY attribute.)

 

Teradata does support GENERATED BY DEFAULT AS IDENTITY columns. You would need to set the START WITH value to not overlap the data you intend to copy, and be sure that subsequent INSERTs are not supplying a value for the column (which would override "BY DEFAULT" behavior).