a simple question about IDENTITY

Tools & Utilities
N/A

a simple question about IDENTITY

hi, i am a novice. these days, i am learning Teradata. today, i read about IDETITY. although i have used identity of sql server, i am still in a puzzle about "GENERATED ALWAYS" and "GENERATED BY DEFAULT".

Would you please tell me about the difference between "GENERATED ALWAYS" and "GENERATED BY DEFAULT"? Can you give me samples/situations about which to use?

Thanks a lot.

1 REPLY
Enthusiast

Re: a simple question about IDENTITY

generated by always means teradata will insert a value of it's own even if you explicitly specified a value for the identity column in your insert.

generated by default on the other hand will generate a value for the identity column only if you didn't specify one in the insert statement.