Identity Columns... GENERATE BY DEFAULT question

Database
N/A

Identity Columns... GENERATE BY DEFAULT question

Hello everyone!

 

Quick question on Identity GENERATE BY DEFAULT. Everything that I'm reading talks about how the Identity values can be changed if the GENERATE BY DEFAULT is used instead of GENERATE ALWAYS. Therefore "uniqueness cannot be guaranteed". 

 

I get the fact that if some user changes an identity value, it could collide with a system-generated value. However, are the *system-generated* values still be guaranteed to be unique? Meaning, if users never change the identity values, will the system continue to churn out unique identity values?

 

Thanks!

 

Joe

 


Accepted Solutions
Highlighted

Re: Identity Columns... GENERATE BY DEFAULT question

Hi Joe,

 

Providing that the generated value doesn't hit any maximum allowed (MAXVALUE attribute) then yes, they will be unique.

 

Just to avoid any confusion, remember that Teradata identity column values may be unique but they will (often) not be sequential - you may have gaps in the numeric values being generated.

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Tags (1)
1 ACCEPTED SOLUTION
2 REPLIES
Highlighted

Re: Identity Columns... GENERATE BY DEFAULT question

Hi Joe,

 

Providing that the generated value doesn't hit any maximum allowed (MAXVALUE attribute) then yes, they will be unique.

 

Just to avoid any confusion, remember that Teradata identity column values may be unique but they will (often) not be sequential - you may have gaps in the numeric values being generated.

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Tags (1)
N/A

Re: Identity Columns... GENERATE BY DEFAULT question

Hello again!


Thanks! That answered my question.

 

Joe