Create table from another table

Sometimes there is a need to create a table from an existing table like back up an existing table and this can be done pretty easily as shown below.

 

SQL Server

           In SQL Server there is a function INTO which does the trick

 

Example:

           select *

           into New_Table  --new table name here

           from Existing_Table --existing table name here

 

Oracle

            In Oracle it can be done by using CREATE TABLE statement

 

Example:

            create table New_Table as  --new table name here

            select *

from Existing_Table;  --existing table name here

 

Thank you for reading this article, check out my other SQL Server vs. Oracle posts.