Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 25 Mar 2014 @ 13:10:31 GMT


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


Subj:   Re: Add new columns in a existing table after
 
From:   Adharssh.HS

Hi,

If you try to add a new column using ALTER Statement, then the New Column will be added at the last.

Suppose, if we need the new column to be in a specific position as a 1st column or in middle, the you need to do like this,

1) RENAME EXISTING TABLE TO BACKUP TABLE

2) CREATE THE NEW TABLE WITH THE SPECIFIED COLUMN POSITION THAT YOU WANT

3) INSERT INTO NEW TABLE SEL OLD COLUMNS FROM BACKUP TABLE (You should use SEL COLUMN LIST, Since New column will not be in the backup table)

4) DROP THE BACKUP TABLE.


Thanks & Rrgards,

Adharssh.



     
  <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