Solved

copy table

Posted on 2010-09-02
3
587 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
ID: 33590781
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
ID: 33590815
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
ID: 33590850
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

839 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