-
Emerald Star member
how to copy the structure of a table ?
How can you copy the structure of a table without copying the data?
-
Sapphire Star member
This is one of the method for copying the structure of table without copying the data is
create table NEWTable AS select * from OLDTABLE where 1=2
-
Emerald Star member
If you want to copy the structure of the table without copying data. Then, use this simple SQL statement.
SELECT *
INTO my_new_table
FROM my_old_table
WHERE 1=2
This code copies the structure of table my_old_table and creates a new table called my_new_table with identical structure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules