Solved

copy table

Posted on 2010-09-02
3
584 Views
Last Modified: 2012-05-10
hi, I would like to copy everything from one table to another
eg i_pn into p_pn then m_pn into p_pn
0
Comment
Question by:RVL
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Christopher Gordon
Comment Utility
Do the table schemas match each other in the tables you're trying to do the copy?
0
 
LVL 14

Accepted Solution

by:
Christopher Gordon earned 500 total points
Comment Utility
if schemas match:

insert into p_pn
select * from  i_pn

you'll get an error if they don't match.

if the table doesn't even exist, I usually use the SQL Import Export wizard.
0
 
LVL 22

Expert Comment

by:pivar
Comment Utility
Hi,

If the table doesn't exist and you want a copy, you can use

select * into p_pn from i_pn

/peter
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now