DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: script which will re-create a table

  1. #1
    Join Date
    Aug 2000
    Posts
    163
    Dear friends,
    Is anyone here who is willing to share a sql which will generate a 'create table..' script based on the existing table?
    What I am trying to do is to maintain all storage paramentrs and rearrange the order of the columns in the table. The table is empty. No need to worry about data. My solution is to drop and re-create the table with a correct order of columns. I would generate a sql scipt for the existing table and change the columns around manually.
    Thank you.

  2. #2
    Join Date
    Sep 2000
    Posts
    384
    Rename table tablename to test;

    now test has column a,d,f,c,b,e as columns in that order

    create table tablename as select a,b,c,d,e,f from test;
    drop test;
    Radhakrishnan.M

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    If you use QUest Software's TOAD there is an option which let you generate these create table *scripts*

Posting Permissions

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


Click Here to Expand Forum to Full Width