Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 01 Oct 2009 @ 13:31:25 GMT


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


Subj:   Re: Modfy data type in a table
 
From:   Rob Paller

Another approach instead of replacing the table:

     ALTER TABLE SMART_APP.TEMP ADD EMP_SALARY1 DECIMAL(18,0);

     UPDATE SMART_APP.TEMP
     SET EMP_SALARY1 = EMP_SALARY;

     ALTER TABLE TEMP DROP EMP_SALARY;
     ALTER TABLE TEMP RENAME EMP_SALARY1 AS EMP_SALARY;

Granted, this approach will not approach the efficiency of a INSERT...SELECT into a new table (non-logged transaction), but if you are constrained by space this may be suitable.


Hope this helps.



     
  <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