Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506

    Smile Unanswered: Importing structure of a table to a new table

    Hi,
    Can anybody help me? I want to create a new table and i want to import the structure of another table to that new table but not the data.I want to do it by executing a single sql statement.Would it be possible?
    Thanks!!
    Joydeep
    Last edited by rudra; 11-30-05 at 17:53.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT * INTO NewTable FROM OldTable WHERE 0=1

    It will not bring over contraints or indexes.

    To do that you need to script the table and copy them so they can be applied.

    Don't know how to script? Look at the first sticky post in this forum and look for the FAQ section
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    thanks a lot.

Posting Permissions

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