Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

copy from one table to another

Posted on 2011-02-16
3
Medium Priority
?
412 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

610 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