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
 Appending two tables

Author  Topic 

masond
Constraint Violating Yak Guru

447 Posts

Posted - 2013-08-13 : 05:28:31
Aim – Append the results from #tablecut on to table #Deletedupes

Table name #tablecut
Columns within #tablecut
Records = 186
Fdmsaccountno
Seller_Code
mcc_code
chain_chain_no
Dba_name
se_number
pca
post_code
rolling12
Segmentation


Table name# #Deletedupes
Columns within # Deletedupes
Records = 11195
Fdmsaccountno
Seller_Code
mcc_code
chain_chain_no
Dba_name
se_number
pca
post_code
rolling12
Segmentation

End result 11389 records
Put into a table called #Results

Would appreciate any help available

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-08-13 : 06:36:59
[code]SELECT *
INTO #Results
FROM (SELECT * FROM #tablecut
UNION ALL
SELECT * FROM #Deletedupes ) T[/code]

--
Chandu
Go to Top of Page
   

- Advertisement -