Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Unanswered: Create empty table copy

    Hi All
    I found that following sql will create a copy, but with same sequence table.
    CREATE TABLE tablename (LIKE oldtablename INCLUDING DEFAULTS);

    But I want to create new empty table copy of existing table with new sequence or copy of existing sequence.

    Is anyone know how to create empty table copy of existing table like this.

  2. #2
    Join Date
    Nov 2006
    Posts
    82
    but with same sequence table.
    What is sequence table?

  3. #3
    Join Date
    May 2008
    Posts
    277
    After you create your new table, you'll have to manually create a new sequence and make that the default value of your column. So unless there are other default column values you're trying to copy, omit WITH DEFAULTS from your statement.

  4. #4
    Join Date
    Jul 2011
    Posts
    2

    Thanks

    Thanks futurity!

    This is for solution for backup table which contain millions of records. By this I can rename the table and make a new table. Hope it is better to do this way, than copying to a new table.

Posting Permissions

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