Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Wed, 07 Nov 2012 @ 16:15:55 GMT


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


Subj:   Re: How to generate Surrogate Key using CSUM?
 
From:   Anderson, Dirk

     INSERT INTO TargetTable
     SELECT CSUM(1,1)+b.Max_Id
     ...
     FROM SourceTable a
     CROSS JOIN
       (SELECT ZEROIFNULL(MAX(MySurrogate_Id)) as Max_Id
        FROM TargetTable
       ) b

Dirk Anderson



     
  <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