Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 19 Nov 2012 @ 21:14:55 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: How to generate Surrogate Key using CSUM?
From:   Nimmala, Meher

Hi Dipti,

There is an identity column feature in Teradata which can generate surrogate key. But as per my opinion generating surrogate key using below SQL (CSUM or Row_Number - Preferred) will be better option. Always do not assume product join is not good. In this case, you are joining only 1 record (max value from target table) with other table and does not make difference. Though target table grows, from your query you are getting max value, so does not hit performance also.

Do not use Rank function as it may generate same values in some cases and leads to failure of Unique violation.


Teradata India Pvt Ltd.

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020