Copy Content from one table to other

  • In Oracle this sql query will work fine ::

    ---------------------------------------------------

    create table tableone

    as

    Select * from tablezero

    ---------------------------------------------------

    In sql server what might be the query to achieve same functionality?

     

    Thanks

     

     

     

     

  • SELECT *

    INTO tableone

    FROM tablezero

    NOTE

    1. Select into/Bulk copy option must be set for database

    2. Primary Keys and Indexes will not be created for new table

    Alternatively

    CREATE TABLE tableone (col1, col2 .... coln)

    INSERT INTO tableone

    (col1, col2 .... coln)

    SELECT col1, col2 .... coln

    FROM tablezero

    As wriiten this will not create Primary Keys and Indexes either but has the advantage that you can specify the PK during the create if required.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply