Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

  • Advertisements

Command to copy table in same database schema

Posted by Pankil Patel on April 8, 2011

create table ABC_COPY as select * from ABC;

Note: It will create new table ABC_COPY in same schema as table ABC, with all data in new table same as original table data.

But new table doesn’t having any constrains created as they are in original table.

You need to add/execute alter script yourself to add constrain in new table.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: