What are the challenges you face when working across database platforms? Take the survey

SQL Compare 13.7 Command Line - Exit Code 126 - SQL Error

howarthcdhowarthcd Posts: 70 Bronze 3
edited July 12, 2019 1:48PM in SQL Compare
Whenever exit code 126 is returned with an output log file configured, the output file does not appear to contain any details of the actual SQL error, making troubleshooting fiddly. The output file contains details up to the point that synchronisation is about to start, but nothing beyond that.


...Checking for identical databases
Creating SQL
Saving SQL
Deploying changes (from DB1 to DB2)

<log end>

However when not logging to file the SQL error text is returned to the command window.

Is there a way to force writing the SQL error to the log file? Am I missing an option?

Using version with the following in a config file:

<?xml version="1.0"?>
  <ignoreparsererrors />
  <synchronise />
  <verbose />
  <force />



  • Options
    howarthcdhowarthcd Posts: 70 Bronze 3
    I've come up with a workaround which is to append the contents of the StandardError property (which contains the SQL error message) of the SQL Compare process to the output text file.

    Not ideal but it does the job in my particular situation.
  • Options
    Eddie DEddie D Posts: 1,789 Rose Gold 5
    Hi, Thank you for your forum post.

    There are no other options other than the   <loglevel>Verbose</loglevel> (/LogLevel:Verbose).  In my experience if the logging process is able to capture the SQL Error details it will include this in the log file.

    As you are using the XML argument file to specify the command line arguments, do you experience the same problem using the command line switches? For example:

    sqlcompare   /server1:localhost /database1:MyDatabase /username1:MyUserName /password1:p@ssw0rd /server2:localhost /database2:MyDatabase2 /username2:MyUserName /password2:p@ssw0rd /ignoreparsererrors /out:"C:\Temp\output.txt" /options:IgnoreUsersPermissionsAndRoleMemberships,IncludeDependencies,IgnoreKeys,DisableAndReenableDdlTriggers,NoTransactions,NoDeploymentLogging,IgnoreIndexes,AddDatabaseUseStatement /loglevel:Verbose /report:"C:\Temp\report.xml" /reporttype:XML /scriptfile:"C:\Temp\scriptfile.sql" /synchronise /verbose /force

    Or using the GUI?

    Many Thanks
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.