How to copy SQL table?

Showing Answers 1 - 8 of 8 Answers

PRATHIMA

  • Sep 9th, 2005
 

COPY FROM database TO database action - 
 
destination_table (column_name, column_name...) USING query 
 
 
eg 
 
copy from scott/tiger@ORCL92 -  
 
to scott/tiger@ORCL92-  
 
create new_emp ?  
 
using select * from emp; 
 
 

  Was this answer useful?  Yes

samiksc

  • Jan 19th, 2006
 

Another syntax for the same is as follows:

  • If the destination table is not existing:

create table desttable as select * from sourcetable;

  • If the destination table is already created:

insert into desttable select * from sourcetable;

Dibyendu Roy

  • Feb 15th, 2006
 

Try with this in SQL SERVER

To create only structue

select * into <destination table> from 

<Source table> where 1=2

To create only structue with data

 select * into <destination table> from 

<Source table> 

ravi

  • Jun 12th, 2006
 

Yes , we can copy the table structure. create table as select * from where 1=2;

  Was this answer useful?  Yes

malapati

  • Oct 9th, 2008
 

to copy a table along with records

 create table  <new table1> as
 select *from <old tablename>;


if we want to copy only structure
 
 create  table < new tablename>
 select *from  <old tablename> where <false condition>;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions