Copy Table Columns and Data

As you may know, in Oracle the syntax from creating a table that is the same as another is:

1
CREATE NEWTABLE AS SELECT * FROM TABLE

In SQL Server, the syntax is slightly different:

1
SELECT * INTO NEWTABLE FROM TABLE

Note: This will not copy indexes, constraints, triggers, or other attributes of the table. It will copy the column names, data type, and data only.

Leave a Reply

Your email address will not be published. Required fields are marked *