Cmd Line: objects are identical or no objects selected

SeaSharpSeaSharp Posts: 10
edited November 2, 2011 2:57PM in SQL Compare Previous Versions
I'm trying to execute a sqlcompare from the command line, like so...
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

Comments

  • 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:
  • Thanks for posting your solution.

    Let us know if you have any other problems.
    Chris
  • SeaSharpSeaSharp Posts: 10
    edited September 26, 2011 9:41AM
    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.
  • 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
  • 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...
    sqlcompare /Project:"C:\Whatever.scp"
    
  • 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
  • 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:
    C:\Program Files &#40;x86&#41;\Red Gate\SQL Compare 9&gt;sqlcompare /Project:"C:\Whatever.scp"
    SQL Compare Command Line V9.0.0.79
    ==============================================================================
    Copyright c Red Gate Software Ltd 1999-2011
    
    Serial Number: &lt;My Serial Number&gt;
    
    Registering data sources
    Creating mappings
    Comparing
    Applying project settings
    Error: The selected objects are identical or no objects have been selected in
    the comparison.
    
  • 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
  • It did work with the command line. But, it also defeats the purpose of having all my settings wrapped up in the project file.
  • 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
  • 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.
  • 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
  • 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
  • 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.
Sign In or Register to comment.