3

I have two SSDT projects targeting the same database. When I use Schema Compare feature from any of the projects, it detects the other project's objects as being non-existent and sets them for deletion.

I cannot merge the two projects into one as I make use of the DAC API and there's a point where I need one compiled before the other. The "dependent" project's objects are all in the same db schema (let's call it myschema), which is unknown from the "core" project.

Is there any way I can setup the SCMP file so that when comparing the "core" project it ignores everything that's placed inside myschema?

Crono
  • 10,211
  • 6
  • 43
  • 75

1 Answers1

1

Not really, the best that I have done is to exclude the things you don't want and then save the SCMP and add it to the project. If you add other objects to that schema though they won't be excluded (if you look in the scmp you can see how the exclusions are done).

I personally find that using the schema compare is a rare thing, it is better (for me) to automate the deployment to my developer database and use that to always keep it in sync with the projects rather than part deploying projects. My process is basically:

  • Write code in SSDT
  • Push all dependent projects to my dev database
  • Test
  • Check-in
  • CI system builds and deploys projects, tests etc
  • CI system builds scripts for other environments / deploys

ed

Ed Elliott
  • 6,666
  • 17
  • 32
  • 1
    The thing is that deployment makes me sooooo nervous! With Schema Compare I at least have a clear preview about the changes that will be published. It saved my butt a few times already now. – Crono Dec 01 '15 at 13:32
  • Automate creating scripts, have tests and manually review the scripts for each environment until you are more confident (plus you should only do schema compare against your own private dev instance - anything else is just waiting for an accident to happen) :) – Ed Elliott Dec 01 '15 at 13:41
  • Well at some point I do need to push changes to the production server. We have an ongoing in-house app here to which we constantly add to. I'm not sure what would be the *best* way to deploy updates. – Crono Dec 01 '15 at 13:53
  • The best way is to have separate databases for each env (dev, test, qa, prod etc), check-in changes and have scripts generated / auto deployed by your ci server if you like to test, qa and prod - (only to qa, when passed test, only to prod when passed qa etc) - you need tests and environments :) – Ed Elliott Dec 01 '15 at 14:00