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.
Author |
Topic |
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2010-08-11 : 06:51:38
|
How to merge two table into a single table in SQL Server using Merge conceptsTable1-----------Col1 Col2------------------1 SaranTable2-----------Col1 Col2------------------2 RajaResultant Table------------------------Col1 Col2------------------1 Saran2 RajaNeed Help.Very UrgentV.NAGARAJAN |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-11 : 07:30:26
|
Merge is the advanced feature of SQL 2008. Not supported in 2005.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2010-08-11 : 07:53:12
|
quote: Originally posted by vaibhavktiwari83 Merge is the advanced feature of SQL 2008. Not supported in 2005.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER
I need in 2008 not old version.V.NAGARAJAN |
 |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2010-08-11 : 08:25:58
|
You might want to move this thread to the 2008 forum. You put it in a 2005 forum and so people assumed you were using 2005.JimEveryday I learn something that somebody else already knew |
 |
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-08-11 : 09:33:41
|
quote: Originally posted by itnagaraj
quote: Originally posted by vaibhavktiwari83 Merge is the advanced feature of SQL 2008. Not supported in 2005.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER
I need in 2008 not old version.V.NAGARAJAN
You could use a union while inserting the data into the resultant table.. like ...declare @t table (Col1 int, Col2 varchar(10))insert @tselect 1,'Saran'declare @r table (Col1 int, Col2 varchar(10))insert @rselect 2,'Raja'declare @result table (Col1 int, Col2 varchar(10))insert @resultselect Col1,Col2 from @tunion allselect Col1,COl2 from @rselect * from @result |
 |
|
|
|
|