Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert data from a table into another

Author  Topic 

aniko
Starting Member

25 Posts

Posted - 2010-12-22 : 19:25:11
I have two tables. One contains ID, Firstname, Surname, Address, Phone

I have another table with just ID, Firstname, Surname and want to "append" this data to the end of the first table.

How do I go about doing so?

Thanks.

rmi
Starting Member

6 Posts

Posted - 2010-12-22 : 19:41:35
Try

INSERT INTO [FirstTable] (ID, Firstname, Surname)
SELECT ID, Firstname, Surname FROM [SecondTable]


//rmi
Go to Top of Page

aniko
Starting Member

25 Posts

Posted - 2010-12-22 : 23:50:55
Thank you! This appears to have worked great.
Go to Top of Page
   

- Advertisement -