[C#] Import data from one server to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mast3rMind
    New Member
    • Feb 2008
    • 2

    [C#] Import data from one server to another

    Hi,

    I'm currently programming in C# 2.0 and I need to code a process that imports data from one table to an other, by using a query of type:

    (SELECT * from table_source where champs in (value1, value2, ...) ==> table_destinati on

    I cannot suppose that my source table is on the same server as the destination table. Here is what I do:

    - Fill a DataTable in memory with data from source table
    - Update destination table by using this DataTable

    I have 10 tables to import, and many tables contain millions of records... you see my problem...

    When I launch my application it takes many hours to complete and it uses a huge amount of RAM... more than 1.5 Go!

    I really need some good advices here.

    Somebody has a better idea than this?

    Thanks a lot in advance!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Have tried to use

    [code=oracle]Insert into target_table select * from source_table[/code]

    Does the target table exists or you want to create that from source table also ?

    If both tables are in different databases make use of DB Link.

    Comment

    • Mast3rMind
      New Member
      • Feb 2008
      • 2

      #3
      Thanks for your help!

      Actually all the tables already exist but my two databases (source and target) are on different servers, so I will have to use DBLink.

      The only thing is I have no idea how to use it in my code (C# 2.0). I cannot find any example on google.

      May somebody show me how to use DBLink please?

      Thank you very much!

      Comment

      Working...