+ Reply to Thread
Results 1 to 3 of 3

Thread: how to copy the structure of a table ?

  1. #1
    Emerald Star member sana86 is on a distinguished road
    Join Date
    Oct 2011
    Posts
    117

    Default how to copy the structure of a table ?

    How can you copy the structure of a table without copying the data?

  2. #2
    Sapphire Star member anusha is on a distinguished road
    Join Date
    Sep 2011
    Posts
    56

    Default

    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

  3. #3
    Emerald Star member sana86 is on a distinguished road
    Join Date
    Oct 2011
    Posts
    117

    Default

    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.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts