Question

I think the question explains itself

Was it helpful?

Solution

Does this help? SqlBulkCopy Class

OTHER TIPS

How about doing a database backup and restore programatically?

I assume you cannot link the servers directly or indirectly and use DTS to do this?

There is a Microsoft.SqlServer namespace that you can use to interact with SQL Server with (see simple example, I once used this to do a complicated business rules data sync operation between remote and local databases. But that was all code, not a point & click utility.

EDIT: You can create and schedule DTS packages (think scripts) to execute multi step data transfer & transformation processes. Here is a link that talks about interacting with DTS in c#

Add the first server as a linked server to the second one. Create the necessary tables and use plain INSERT...SELECT to copy the data. You could also use OPENDATASOURCE function instead of creating a linked server.

If you cannot configure the servers to access each other, you could just read the data to your app - using a DataTable or DataSet, - and then use SqlBulkCopy to write it to another server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top