Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 12 Jul 2006 @ 20:13:13 GMT


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


Subj:   Re: Efficient way to modify column datatype.
 
From:   John Graas

  Modify the table, add the new column.  


  Update the table, setting the new column to the data value in the old column (cast or whatever as necessary).  


  Modify the table, drop the old column.  


One caveat: for large tables, the Transient Journal caused by the table update in place my be prohibitive in processing time.

Another approach is to:

     Create a new tablename with the desired DDL changes;
     Insert/Select into the empty table including the data conversion for the

     new column data type;
     Drop old table;
     Rename new tablename to old tablename.

jdg

www.jgraas.com



     
  <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: 15 Jun 2023