With the right version of Visual Studio 2012 we can have database compared and synced
I\'m looking for way to integrate this synchronization process into a TFS build as
Things changed a bit between VS 2010 and 2012. Assuming you're using VS 2012 (the link you posted was to 2010 tech), that means you're using SSDT (SQL Server Data Tools).
So long as your SSDT project is part of the solution you've selected to build in TFS Build, it will build and output a .dacpac
file. Then you can automate the deployment by calling the sqlpackage.exe
here (either directly from the TFS Build, or like I do by having the TFS Build call a powershell script that does the heavy-lifting). sqlpackage.exe
takes input as a .dacpac file and a publish profile with the environment-specific config values necessary for deployment.
Update
To drop the not in source
object(s) on target database, e.g. the removed tables and columns in .dacpac, use /p:DropObjectsNotInSource=true