Combining two data base of the same schema
-
i have a data base called DBTest on machine one and contains a table called DTTable1 and i have the same database DBTest on machine Tow. now i filled the data into DTTable1 on machine one from "A" to "K" and i filled the data from "L" to "Z" on machine Two. What i want is to Combine the data from DTTable1 in the Machine One with the DTTable1 on Machine Two. How that can be done?:( Faris Madi Nothing Comes Easy (N.C.E.)
-
i have a data base called DBTest on machine one and contains a table called DTTable1 and i have the same database DBTest on machine Tow. now i filled the data into DTTable1 on machine one from "A" to "K" and i filled the data from "L" to "Z" on machine Two. What i want is to Combine the data from DTTable1 in the Machine One with the DTTable1 on Machine Two. How that can be done?:( Faris Madi Nothing Comes Easy (N.C.E.)
Hi! It depends if you want to combine the content within a SQL statement without transferring the data permanently or if you want to create a third table that physically contains the combined data. If you need a query and you do not want to tranfer the data 1. create a linked server from machine one to two (or the other way round; you can do this in SQL Server management studio (2005) or Enterprise Manager (2000) 2. select * from DBTest.dbo.DTTable1 union all two.DBTest.dbo.DTTable1 As an alternative to 1 you can also use OPENQUERY or OPENROWSET (see SQL Server Books Online for details). If you want to move the combined data into a third table use DTS (SQL 2000) or SSIS (SQL 2005). With these tools it is quite easy to move data from one table into another. Hope this helps. Regards, Rainer. Rainer Stropek Visit my blog at http://www.cubido.at/rainers