Resume after ExecuteBlock

MartinHMartinH Posts: 82 Bronze 2
edited August 6, 2015 7:16AM in SQL Comparison SDK 11
Is there anywhere I can pick-up a brief resume of the action carried out by ExecuteBlock?

I'm looking for something like:
x Records added to TableX
x Records modified in TableX
x Record deleted from TableY

Thanks,
Martin.

Comments

  • Anu DAnu D Posts: 876 Silver 3
    Hi Martin,

    Thanks for your post.

    From the sample examples can you have a look at: GetFeedbackExample.cs

    This example reports on SQL Compare's progress by displaying any messages or percentage notifications on the console.

    Let me know if this helps.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: [email protected]
  • MartinHMartinH Posts: 82 Bronze 2
    Unfortunately, this was not my question. I am currently using feedback, and have no issues with this.

    My question was if there is a resumé of commands that have been performed by the Data Compare engine.

    For example:
    x Records were added to TableX
    y Records were deleted from TableX
    z Records were updated on TableX
    ...etc. for each table in the database.
  • MartinHMartinH Posts: 82 Bronze 2
    I have found the solution, and show it here in case in might help other users:
    ...
    RedGate.SQLDataCompare.Engine.SqlProvider provider = new RedGate.SQLDataCompare.Engine.SqlProvider(Options);
    using(RedGate.Shared.SQL.ExecutionBlock.ExecutionBlock block = provider.GetMigrationSQL(session, true))
    {
      foreach(RedGate.SQLCompare.Engine.Message msg in provider.Messages)
      {
        // You can get the information about what is going to happen here using the msg.Text property!!
      }
      RedGate.Shared.SQL.ExecutionBlock.BlockExecutor executor = new RedGate.Shared.SQL.ExecutionBlock.BlockExecutor();
      executor.ExecuteBlock(block, sqlHostTarget, databaseNameTarget);
    }
    

    Hope this helps,
    Martin.
  • Hi Martin,

    Thanks for posting the solution!
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: [email protected]
Sign In or Register to comment.