Cmd Line: objects are identical or no objects selected

Forum for users of SQL Compare schema synchronization utility

Moderators: JonathanWatts, Chris Auckland, David Atkinson

Cmd Line: objects are identical or no objects selected

Postby SeaSharp » Wed Sep 21, 2011 9:23 pm

I'm trying to execute a sqlcompare from the command line, like so...
Code: Select all
sqlcompare /Project:"C:\\Whatever.scp"

It returns the error message, "The selected objects are identical or no objects have been selected in the comparison." The DB's are not identical & the compare successfuly shows this when using the SQL Compare desktop. Yes, I did see this post which states that "you'll need to run a comparison, check the boxes, and save the project." That isn't working for me. I've tried...

1. Creating the project, executing the compare then saving the SCP.
2. Creating the project, saving the SCP then executing the compare.

I'm not having any luck. I'm using SQL Compare 9.0.0.79 Professional Edition from the Sql Developer Bundle.

Thanks
Last edited by SeaSharp on Tue Sep 27, 2011 6:10 pm, edited 1 time in total.
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby SeaSharp » Thu Sep 22, 2011 3:31 pm

Ahh...figured it out. The "no objects have been selected" refers to the things you want to synchronize after the compare is complete. It is not the things you want to compare.
:roll:
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Mon Sep 26, 2011 12:35 pm

Thanks for posting your solution.

Let us know if you have any other problems.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby SeaSharp » Mon Sep 26, 2011 2:31 pm

Thanks Chris. So, is there a way to execute JUST the compare from the command line using a SCP? I'm trying to integrate with CruiseControl.Net. I don't want to sync, just compare.
Last edited by SeaSharp on Mon Sep 26, 2011 2:41 pm, edited 1 time in total.
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Mon Sep 26, 2011 2:33 pm

Yes, if you don't use the /synchronize(/sync) switch, then only the compare operation will be performed.

To synchronize, you have to specify the /sync switch.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby SeaSharp » Mon Sep 26, 2011 2:40 pm

I'm not using that switch. Yet, I get the error message that there are no objects to compare. This is all I'm doing...
Code: Select all
sqlcompare /Project:"C:\\Whatever.scp"
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Mon Sep 26, 2011 2:55 pm

This is a bit strange. The command line comparison should be exactly the same as the GUI comparison.

What differences are being reported in the GUI? Are the objects listed in any of the 'objects with differences' groups in the top of the results grid, or are the differences only noticed in the SQL Differences pane at the bottom of the screen?
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby SeaSharp » Mon Sep 26, 2011 3:18 pm

In the GUI, at the top grid, I have:

+ 102 objects that exist in both but are different
+ 2 objects that exist only in <ServerName>.<DatabaseName>
+ 808 identical objects

All of the 102 differences are found in stored procedures. When I click the stored procedure name it brings up the SQL pane and highlights the difference in green. They are definitely different.

This is what the compare looks like when executed from the command line:

Code: Select all
C:\\Program Files (x86)\\Red Gate\\SQL Compare 9>sqlcompare /Project:"C:\\Whatever.scp"
SQL Compare Command Line V9.0.0.79
==============================================================================
Copyright c Red Gate Software Ltd 1999-2011

Serial Number: <My Serial Number>

Registering data sources
Creating mappings
Comparing
Applying project settings
Error: The selected objects are identical or no objects have been selected in
the comparison.
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Mon Sep 26, 2011 5:10 pm

What happens if you use the command line switches rather than referencing a project file? e.g.

C:\\Program Files (x86)\\Red Gate\\SQL Compare 9>sqlcompare /s1:MySourceServer /db1:MyDB /s2:MyTargetServer /db2:MyDB /options:default
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby SeaSharp » Tue Sep 27, 2011 4:42 pm

It did work with the command line. But, it also defeats the purpose of having all my settings wrapped up in the project file.
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Fri Sep 30, 2011 9:18 am

I haven't been able to reproduce this yet.

Does the problem remain if you create a brand new project file?

Also, could you try using the /Include:Indentical switch with the project file?

If neither of these make a difference, would you be able to send me a SQL Compare snapshot of the source and target schemas, and also the project file?

I should then be able to recreate the project here.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby SeaSharp » Fri Sep 30, 2011 4:38 pm

I tried using the /Include:Indentical switch. I got an error message stating the switch is not allowed when specifying a project file.

I created a new project file from scratch. It still had the same problem

Unfortunately, I cannot send the schema because it is a sensitive problem domain related to safety & security. I realize that limits your ability to help me. Perhaps I can try to reproduce the problem with a new mock database. I'll see what I can do.
SeaSharp
 
Posts: 9
Joined: Wed Sep 21, 2011 9:00 pm

Postby Chris Auckland » Tue Oct 04, 2011 3:33 pm

That would be great if you could.

You also might like to try using an XML arg file instead of the project file as a workaround. You reference the arg file like you reference the project file, but it's not as easy to create as there isn't a UI for it.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby bcpreece » Wed Nov 02, 2011 5:23 pm

I am also having this problem. I have 7 differences in my project but I get the same error. I am also using a project file.

Error: The selected objects are identical or no objects have been selected in
the comparison.

I tried adding the include statement to my xml document but I want to use 3 types in my include statement so I get differences, missing and add but when I put that in my xml file I get this error.

Error: The /include and /project or /filter switches cannot be specified
together with anything other than /include:identical
bcpreece
 
Posts: 32
Joined: Mon Mar 26, 2007 8:52 pm

Postby Grimbear13 » Wed Nov 02, 2011 7:57 pm

Was having this problem and you guys cleared it up. On your second post you mentioned selecting the "Items for synchronization". So in my project I selected what I needed saved the project and now it displays the results.
Grimbear13
 
Posts: 1
Joined: Wed Nov 02, 2011 7:48 pm


Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests