Copy from one database table to another C#

前端 未结 5 721
情话喂你
情话喂你 2021-01-02 10:03

Using C# (vs2005) I need to copy a table from one database to another. Both database engines are SQL Server 2005. For the remote database, the source, I only have execute ac

5条回答
  •  抹茶落季
    2021-01-02 10:53

    I would first look at using SQL Server Intergration Services (SSIS, née Data Transfer Services (DTS)).

    It is designed for moving/comparing/processing/transforming data between databases, and IIRC allows an arbitrary expression for the source. You would need it installed on your database (shouldn't be a problem, it is part of a default install).

    Otherwise a code solution, given the data size (small), pull all the data from the remove system into an internal structure, and then look for rows which don't exist locally to insert.

提交回复
热议问题