Microsoft Database Sync set up Continuous Integration with TFS 2012

徘徊边缘 提交于 2019-12-02 02:06:07

问题


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 in Continuous Integration for code; now I need that for database schema and data.

Please share if you know how to do it.


回答1:


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



来源:https://stackoverflow.com/questions/20320000/microsoft-database-sync-set-up-continuous-integration-with-tfs-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!