0

I am trying to automate the following steps:

We currently try to keep our database project (.sqlproj) up to date with out database, but this is currently a manual procedure. We open Visual Studio, put our database as source, put our sqlproj as target, select the pieces we want (we only need the tables, views, indexes and stored procedures) and then run a comparison. When that is done, we hit the 'update' button and our sqlproj file gets updated with the files generated or updated. We check this in and done.

enter image description here

Now I'm trying to automate this process. I'm able to generate the source dacpac file with sqlpackage and I can run a comparison script with the dacpac generated using msbuild OR update a target database, but I can't find how to update the sqlproj like the Update button on the above screenshot does.

I've found DACExtensions to try to simulate the behaviour, but it seems the Update button works in its own specific way.

Long story short: what command do I need to run in order to simulate the 'Update' button?

Any and all help would be appreciated :)

Eviler
  • 39
  • 6
  • Automation is usually used to support the opposite process: change the _sources first_ and _deploy changes to production after_. – Ivan Starostin Jan 27 '22 at 15:51
  • If you prefer your way, then I'd say you don't need comparison at all. Dump what you have from prod and that's it. Maybe clear the folder (?) beforehand. – Ivan Starostin Jan 27 '22 at 15:53

0 Answers0