Compare Database revisions without SQL Sourcecontrol

Forum for users of SQL Compare schema synchronization utility

Compare Database revisions without SQL Sourcecontrol

Postby Psyonity » Fri Aug 08, 2014 11:57 am


I am working on automatic making of sql scripts with TFS Build workflow for our installation packages. I can get the comparisation of 2 different databases working, but more preferably I want to compare one database that is under SQL Source control from a specific revision to the HEAD revision. I currently got the following command line:

Code: Select all
SQLCompare.exe /sourcecontrol1 /db2:Application_2030 /sf:"D:\\Upgrade - 02 - Model.sql" /s2:databaseServer\\Development /f /r1:5000 /r2:HEAD

I use the SQL Automation Pack to get the SQLCompare CLI.

But when I try to run it, it returns:

Code: Select all
Using source controlled databases requires SQL Source Control to be installed.

That's correct, because I don't have SQL Source Control installed on the Build Agent.

I have complete access to the TFS Server where the database is source-controlled from the executing agent and also got full access to the database server from my build agent.

So my question is, is it possible to create a SQL Script with the SQLCompare tool between two revisions without Sql Source Control installed? Can it also get the revisions from TFS?

For me it sounds strange to install SSMS and SQL Source Control on my build agent while I never open the Program itself on the machine nor do check-ins or database changes.

Posts: 2
Joined: Mon Dec 30, 2013 4:06 pm

Postby Brian Donahue » Mon Aug 11, 2014 1:49 pm

SQL Compare uses shared components from SQL Source Control, so it needs to be installed. I do not believe that you need it to be licensed on the build server though, just installed.

You could also use the components that come with your version control system to get the files from source control into a scripts folder, but that solution doesn't appear to work if you use the "migrations" feature, because SQL Compare does not let you specify a scripts folder on disk together with the migrations folder files on disk.

There are two solutions, but I think the best one is to install SQL Source Control. I tried SQL Compare with a repository data source and it works with SQL Source Control having an expired trial.
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 9:48 am

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests