How can we help you today? How can we help you today?

How can I get the exit code from running SqlDataCompare in PowerShell?

We need to know if the data compare synchronization was successful for a database before synchronizing the next database.
How can I get the exit code to see if there was a problem? And if there was no difference, is this considered a failure?
Paul_at_HCI
0

Comments

1 comment

  • Peter_Laws
    Hello Paul_at_HCI,

    Our cli tools write out their exit code to the terminals standard output, so in the instance of Powershell, that's 
    $LASTEXITCODE

    Using the SQL Data Compare Exit codes used in the command line document, you can write the logic for how you want the workflow to behave. There is a code dedicated to finding identical dbs.

    As for failure or not, that's dependant on how you configure it, please see the '/Include:Identical' option in cli switches document.
    Peter_Laws
    0

Add comment

Please sign in to leave a comment.