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 from two different tables

Author  Topic 

Beginer2012
Starting Member

45 Posts

Posted - 2012-06-18 : 13:03:07
Hello,
How can I insert into a table all records from two other tables.

Table A = Table B + Table C

Thank you

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-06-18 : 13:08:53
INSERT TableA
SELECT * FROM TableB
UNION ALL
SELECT * FROM TableC
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-06-18 : 14:40:36
hope you want to include duplicates else you might have to use UNION instead

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -