CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Custom Sync Tool

Threaded View

  1. #1
    Join Date
    Mar 2013

    Custom Sync Tool


    How I can create one application that get results from one MS SQL Server query
    compare them with one MYSQL Server query and if it is equal then do update else do insert.

    For example, let say I have my source sql query
    Select ID, FName, LName From TBNames
    ID | FName | Lname
    1 | John | Eaglin
    2 | Harry | Baggerly
    3 | Charlie | Abbett
    4 | George | Dent

    Then from Mysql query I have the result
    Select ID, fName, LName from MYNames where ID = {MSSQL_ID};
    ID | FName | Lname
    1 | John | Smith
    2 | Tomas | Ford

    I need to pass through ID field and update ID 1 and 2 from Smith to Eaglin
    from Tomas Ford to Harry Baggerly and insert the other 2 records.
    Running the same select on MYSQL I get the result
    ID | FName | Lname
    1 | John | Eaglin <-- Last Name changed
    2 | Harry | Baggerly <-- Both Names changed
    3 | Charlie | Abbett <-- Inserted
    4 | George | Dent <-- Inserted
    The problem is that queries are many with lot of different fields and tables.
    Is there any way I can pass fields names and results as variables to the update or insert query?

    Thank you
    Last edited by makis_best; November 27th, 2018 at 03:57 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)