 |
 |
Archives of the TeradataForum
Message Posted: Wed, 12 Jul 2006 @ 20:13:13 GMT
| 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
| |