Solved

copy from one table to another

Posted on 2011-02-16
3
391 Views
Last Modified: 2012-06-27
Hi

i would like to copy everything from talbe a_dupe to b_dupe

thanks
0
Comment
Question by:RVL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 500 total points
ID: 34911521

insert into b_dupe
select * from a_dupe
0
 
LVL 26

Expert Comment

by:tigin44
ID: 34911593
if you have an identity column on b_dupe table you should also set the identity insert as...

SET IDENTITY_INSERT b_dupe ON

INSERT INTO b_dupe
SELECT *
FROM a_dupe
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 34912944
Actually if you have an IDENTITY column you need to explicitly name all your columns.  Also, don't forget to turn off INDENTITY_INSERT once done.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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.

737 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