Solved

copy from one table to another

Posted on 2011-02-16
3
350 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
3 Comments
 
LVL 32

Accepted Solution

by:
ewangoya 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

IT, Stop Being Called Into Every Meeting

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

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

762 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

19 Experts available now in Live!

Get 1:1 Help Now