Red Gate forums :: View topic - Getting error notifications with command line
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Getting error notifications with command line

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Tue Jul 03, 2012 6:42 pm    Post subject: Getting error notifications with command line Reply with quote

Having problems with SQL Compare 10 that I didn't have with SQL Compare 8.

Here's my command line:
Code:

"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:

Quote:
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
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon Jul 09, 2012 10:45 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Mon Jul 09, 2012 1:18 pm    Post subject: Reply with quote

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??
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon Jul 09, 2012 3:37 pm    Post subject: Reply with quote

Yes, I am very sorry about the lack of documentation. but did you check the log file to see what went wrong?
Back to top
View user's profile Send private message
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Mon Jul 09, 2012 3:55 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Jul 09, 2012 4:04 pm    Post subject: Reply with quote

Does adding /verbose to the command line invocation help?
Back to top
View user's profile Send private message Send e-mail
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Mon Jul 09, 2012 4:24 pm    Post subject: Reply with quote

Brian,

You mean like:
Code:
"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
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Jul 09, 2012 4:45 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Mon Jul 09, 2012 5:23 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Jul 09, 2012 5:57 pm    Post subject: Reply with quote

One approach is to generate the .sql script

Code:
sqlcompare /Project:"D:\Project.scp" /reporttype:simple /report:"D:\Project.html" /ScriptFile:DeploymentScript.sql


and then apply it separately using:

Code:
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.
Back to top
View user's profile Send private message Send e-mail
mbgrove



Joined: 03 Jul 2012
Posts: 6

PostPosted: Mon Jul 09, 2012 6:46 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group