Unfortunately there is nothing simple in .net to do this, The best thing I have ever found for something like this is the lowly Jet Provider of all things... Take a look at the following
code (Would need to be modified a bit to work in .Net as this is VB6 code, but the idea is in the SQL Statement_ It opens a connection to an empty MDB file and then uses the
provider to do a dandy insert from one SQL Server to another (Using ODBC) You could substitute most any ODBC Complient database into this and make it work...
Dim cn As ADODB.Connection
Dim strSQL As String
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\AnEmpty.mdb"
strSQL = "Insert INTO [ODBC;Driver={SQL Server};Database=Northwind;" _
& "Server=Server1;uid=sa;pwd=Password1;].[products](ProductName,SupplierID," _
& "CategoryID,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder,ReorderLevel," _
& "Discontinued) select ProductName,SupplierID" _
& ",CategoryID,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder" _
& ",ReorderLevel,Discontinued FROM [ODBC;Driver={SQL Server};Database=Northwind;" _
& "Server=Server2;uid=sa;pwd=Password;].[products]"
cn.Execute strSQL
Want to know more? Check out the MSDN Library at
http://msdn.microsoft.com or the Microsoft Knowledge Base at
http://support.microsoft.com
Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email :
(E-Mail Removed) <Remove word online. from address>
This posting is provided “AS IS”, with no warranties, and confers no rights.
--------------------
>Content-Class: urn:content-classes:message
>From: "James Bolles" <(E-Mail Removed)>
>Sender: "James Bolles" <(E-Mail Removed)>
>Subject: Data Sync in .NET for SQL Server and Sybase
>Date: Wed, 30 Jul 2003 18:48:29 -0700
>Lines: 9
>Message-ID: <051f01c35705$d7253a20$(E-Mail Removed)>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcNXBdclIhaCdn4QS6qDTwgBcOiRfg==
>Newsgroups: microsoft.public.dotnet.framework.adonet
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57098
>NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
>X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>
>I have a situation where I want to move data into a
>source database and then replicate that information into
>two target databases that are legacy systems. I was
>considering using COM+ and ADO .NET but the sybase
>database is on UNIX
. Anyone ever try to do
>heterogenous data replication in .NET/Sql Server?
>
>Thanks,
>James
>