compare script objects with slightly different filenames

Based on the command line options I'm seeing for SQL Compare, it does not appear possible to compare individual script files with slightly different filenames.  Is this correct? There seems to be only one /filter option which is applied to both files at the session level.  SQL Compare can't compare "[dbo].[spGetActiveItems].sql" against "dbo.spGetActiveItems.sql" because it's hardcoded to only compare identical filenames?

I was hoping to script SQL Compare to identify drift between our preexisting sql repository and the database, but I'm not seeing a direct way to do this. It appears we'd need to completely rebuild our sql repository structure to the script output SQL Compare is hardcoded for.

Best Answer

  • David AtkinsonDavid Atkinson Posts: 1,384 Rose Gold 2
    Accepted Answer
    SQL Compare ignores the filenames. What's important is the name of the objects within the files, which in your example are identical as square brackets should be ignored by SQL Compare's semantic comparison engine. Can you provide an example of what incorrect change it's trying to make?
    David Atkinson
    Product Manager
    Redgate Software

Answers

  • OnanSaladOnanSalad Posts: 4 New member
    You're absolutely right, @David Atkinson.  I made an incorrect assumption based on the command line switch documentation. After some experimentation (and removing 2nd instances of certain objects that prevented SQL Compare from loading the script files), I now have an Excel report showing drift between our db and repo.

    Thanks for your help!
  • @OnanSalad We're always open to improving the documentation. If you could point me to where you looked, I'll see if it can be made clearer!
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.