Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 26 May 2009 @ 20:29:12 GMT


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


Subj:   Re: Creating one table from another
 
From:   Michael Larkins

If you want the exact same table including constraints I am amazed the no one has mentioned the following method.

Create a table from an existing table using following syntax:

     CREATE TABLE A as B with no data;

If you wanted all of the rows, then you could use WITH DATA which is pretty fast because it simply copies the existing blocks (not row level - no SELECT) and assigns them to the new table. When using WITH NO DATA there is no need to copy anything except the entire table definition.


Regards,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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