May 2, 2012 at 12:00 am
Hi,
I am having two tables that table name Test1 & Test2. Two tables are same and Test2 is the backup table for Test1. Now i need to do some checking in Test1. So i need to move all the data from table Test1 to Test2. Could you please give the suggestion and how write the query for this task?
Note : I have already created the table name and column name for Test2 as Test1. Test2 have the existing data also. So i need to update from Test1
Thanks
Guvera
May 2, 2012 at 12:38 am
Hi,
Insert into Table2(Column1, column2,column3...)
Select (Column1, Column2, Column3, ...)
From Table1.
If they are in different databases then use as <DatabaseName.dbo.TableName>
May 2, 2012 at 12:39 am
Guvera (5/2/2012)
Hi,I am having two tables that table name Test1 & Test2. Two tables are same and Test2 is the backup table for Test1. Now i need to do some checking in Test1. So i need to move all the data from table Test1 to Test2. Could you please give the suggestion and how write the query for this task?
Note : I have already created the table name and column name for Test2 as Test1. Test2 have the existing data also. So i need to update from Test1
Thanks
Guvera
From what I understand, you are looking to MERGE THE TWO TABLES
May 2, 2012 at 2:32 am
Thanks. Its working fine now.
May 2, 2012 at 2:36 am
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply