Getting error notifications with command line

mbgrovembgrove Posts: 7
edited July 9, 2012 1:46PM in SQL Compare Previous Versions
Having problems with SQL Compare 10 that I didn't have with SQL Compare 8.

Here's my command line:
"D:\sqlcompare" /Project:"D:\Project.scp" /reporttype:simple /report:"D:\Project.html" /out:"D:\Project2.txt" /sync

As you can see, I had the output going to a file Project2.txt.

In SQL Compare 8, if something happened with the script and the script blew up, I could find it in my Project2.txt file.

I currently have a database that is blowing up completely and all I get is:
Serial Number: 511-001-124643-D86B

Registering data sources
Creating mappings
Comparing
Applying project settings
Retrieving migration scripts
Creating SQL
Deploying changes (from DB1 to DB2)

Not very helpful as per there is no indication whatsoever that there was an error running the script.

So... with SQL Compare 10, how do I get some notification of an error inside my output file?

Thanks.

Michael

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    There are different types of errors thrown by the program, and this may be a programming error which normally would not appear in the output.

    What you can try is to add /logLevel:v to the command and that will create a verbose log file in %userprofile%\appdata\local\red gate\logs\sql compare. Perhaps information about the problem is logged there.
  • To reiterate: I didn't have this problem with SQL Compare 8. If the database update failed, it showed on the screen/in the output file.

    In an output file I could name and place myself, instead of a log file that is somewhere defined by the system named whatever it wants to be named.

    There is nothing in the documentation that indicates that there are any changes in what gets sent to the output file.

    I would like to know how to get the information I had before into the output file.

    What good is an output file if it doesn't even tell me that the whole database synchronization failed??
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Yes, I am very sorry about the lack of documentation. but did you check the log file to see what went wrong?
  • I had previously tested the log file avenue. Yes, it shows the errors that were received.

    Are you saying that I'm stuck with the log files that I can't name or place where I want because the output files no longer return the information they used to?
  • Does adding /verbose to the command line invocation help?
    David Atkinson
    Product Manager
    Redgate Software
  • Brian,

    You mean like:
    "D:\sqlcompare" /Project:"D:\Project.scp" /reporttype:simple /report:"D:\Project.html" /out:"D:\Project2.txt" /sync /verbose
    

    Didn't know that was a command line switch as per it's not in the command line documentation I found. However, I did go ahead and try it. It gave me more information at the beginning, but still stops at the same place I noted in my original post.

    Some clarification - The error I'm getting is when the SQL script is trying to run and it fails due to a problem with constraints or the like. This is not an error with SQL Compare 10 itself. Sorry if this confused the matter.

    Thanks.

    Michael
  • Is the issue that you want to see what the error is in the output, or that you think there shouldn't be an error in this instance?

    If the latter, please confirm that you can reproduce this bug using the SQL Compare UI, and if so, take snapshots of the source and targets and email this to support@red-gate.com , who will try to reproduce it in-house.

    David Atkinson
    Red Gate
    David Atkinson
    Product Manager
    Redgate Software
  • Updated:

    David,

    The issue is that I want to see what the error is in the output file.

    The database is messed up and will not update without manual intervention, but the output file doesn't indicate there was any problem.

    Thanks.

    Michael
  • One approach is to generate the .sql script
    sqlcompare /Project:"D:\Project.scp" /reporttype:simple /report:"D:\Project.html" /ScriptFile:DeploymentScript.sql
    

    and then apply it separately using:
    sqlcmd -b -E -SYourSQLServerInstance -dYourDB -i DeploymentScript.sql
    
    (use -U and -P instead of -E if you're using sql server authentication)

    This way sqlcmd will output the SQL errors to the console.
    David Atkinson
    Product Manager
    Redgate Software
  • OK guys...

    Yes, I can use the log file, even though it's not user-friendly in the way of placing or naming what we want and it states it's more for you guys in your online documentation.

    Yes, I can take another step and generate a SQL script and run that separately with sqlcmd to be able to trap the error.

    But I shouldn't have to. I would be taking a step backwards from the functionality of a previous version.

    Fortunately, the multiple databases I have automated to be updated on a daily basis are not yet production databases. If these had been production databases and the output file, which had always worked before, suddenly no longer returns the information it did before, I would be screwed if there was an error, plain and simple.

    So... what happened to /out? Honestly. I have been given no explanation or reason for why /out doesn't return the same information it did before, and there is no documentation to back up the fact that it doesn't return the same information it did before.

    And, interestingly enough, you asked me to try a switch, /verbose, that isn't in the online command line documentation either.

    I feel like I've gotten the run-around to avoid answering what happened to the /out feature.

    Whether you want to admit it or not, this is a fairly serious change in the program that needs to be resolved in one way or the other.
    1) Get /out to return what it did before.
    2) Document that /out no longer returns specific information, or better document what information it DOES return.

    Michael
Sign In or Register to comment.