Archives of the TeradataForum
Message Posted: Fri, 06 Jan 2005 @ 22:17:28 GMT
I would agree with Chris. The only thought I would add would be that if you *don't* have enough space for two copies of the table then do the data transfer in chunks.
Use Chris's create table process but modify the "with data" clause to read "with no data".
This will create an empty copy of the table.
Then run insert selects as required to transfer the data. As per this simple example:
/* Set up a test table and some data */ create table test ( i1 integer, i2 integer, c1 char (12) ) primary index (i1, i2); insert into test (1, 2, 'hello 1,2'); insert into test (2, 1, 'hello 2,1'); /* Now duplicate the table definition */ create table test_copy as test with no data; /* Finally copy the data chunk by chunk */ insert into test3_copy select * from test where i1 = 1; /* Free up some space to do the next block */ delete from test where i1 = 1; /* Repeat the above two queries as required - then continue as per Chris's renaming process */
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|