Command line tool (or API) for SQL Source Control Integration
We have an automated system for building our developer environments. It would be nice to have a command line tool that we can use as part of the machine build script to pull down the latest version of the database, build the initial database and link that database back to the TFS source. Our platform consists of quite a large number of databases so linking to them all manually via the UI is a bit tedious.
Thank you everyone for the suggestions and votes for this over the years.
I’d like to surface up a workaround for the “linking” problem which is mentioned in the comments. For the use case of easing pains around environment setup with a large number of databases, we have had customers find success using code based off Alessandro Alpi’s blog post: https://alessandroalpi.blog/2016/06/28/automatically-link-databases-to-red-gate-sql-source-control/
I do understand that this is a broader issue and hear that many of you also want command line or API support for the product in general.
If there are specific scenarios or workflows that would be useful to automate for you, this feedback is also very useful, and if you have details on the type of VCS you use and the workflow (such as a branching model) that it would fit in to, that would be very helpful for us to hear as well.
-
MCTSQL commented
Command line access to SQL Source Control's actions is exactly what I need as well.
-
MCTSQL commented
Command line access to SQL Source Control's actions is exactly what I need as well.
-
Colin Smith commented
Hi Stephanie, the building of the local databases isn't really a problem - I'm already looking at the SQL Compare SDK to write a custom MSBuild task to do it - the main thing is linking the databases on the local machine back to source control once they are built. One of our platforms has 40 databases, and linking to them all manually after building a new dev machine would be quite time consuming.
-
Hmm... We don't have anything like this yet, but I wonder if you could put something together using your source control system's API and SQL Compare Pro's command line, which could be used to update your database from scripts. You would need to update the LinkedDatabases.xml file as well... I'm not sure if this would work... Here's a paper on continuous integration, which may help because it shows how to checkout the scripts folder and then compare and synch this to a db, http://www.red-gate.com/help/Continuousintegration.html.