SQL Compare order of clauses

mika76mika76 Posts: 20
edited February 18, 2016 5:31AM in SQL Compare 11
Is there any way to keep the order of clauses that are exported with a compare. I notice that if I just add a new table or stored proc and rerun a sql compare (I have an automatic, command line one running within my build) that the order of clauses in the exported script is totally different than the previous one. Is it not possible to keep the order consistent, fallback would be the name of the object being exported maybe?

Comments

  • Hello,

    Unfortunately there is no way to keep the order between deployments, there is no information passed from one running of SQL Compare to the next. If the objects stay the same the order should but as you've noticed if you add objects then it will change when incorporating those.
    Allen LeVan
    Red Gate Software
    US Product Support
  • Can you maybe explain why a simple dependency then alphabetical order would not work?
  • Actually I notice that it's only happening with the command line tool. when I run the following
    "c:Program FilesRed GateSQL Compare 10SQLCompare.exe" /scripts1:"..ADatabase" /scripts2:"..APreviousDatabase" /scriptfile:"C:Builds2A_PatchComparisonBinaries\patch.sql" /Include:Identical
    

    It gives me a nice script which I can use or save for future, but if I run the same thing twice, with no changes at all, the whole script is in a different order, so if I look at it in a comparison tool I get gibberish.

    Going through the UI, where you select the items to script, the script comes out the same each time it seems. So this seems to be a problem with the command line tool specifically (The UI seems to order by dependency, then by alphabetical as mentioned in previous post)
  • Bump - anyone?
  • Bump - come on guys - it's a simple question...
  • mika76 wrote:
    "c:Program FilesRed GateSQL Compare 10SQLCompare.exe"
    

    We made SQL Compare significantly more deterministic between versions 10.4 and 11. You might have better luck if you try upgrading, at least in the cases where the database has not changed.
    Software Developer
    Redgate Software
Sign In or Register to comment.