Reputation: 11
I would like to create a tool to compare my SQL Development Database with Source control repository and create a deployment script to sync both. But I don't have any idea how to proceed. Any suggestions please
Upvotes: 0
Views: 357
Reputation: 61
Do you have a file-based source control such as SVN, Git, Perforce to manage your database objects?
With database code deployment using file-based version control repository will cause the following issues:
Those source control do not act as the single source of truth because anyone can login to the database and produce a change and forget to apply it in the relevant script of the file-based version control.
What’s needed for the database is baseline aware analysis. I recommend you download this white paper for a full discussion on this subject.
Upvotes: 0
Reputation: 6856
You have a couple of options, the first is paid you can do it with the Redgate SQL Compare tool or you can get SSDT, create a database project, add your code to it and use that to do the sync (either use sqlpackage or schema compare).
My personal preference is SSDT but the RG paid for solution is simpler.
Upvotes: 1