Microsoft Database Sync set up Continuous Integration with TFS 2012

前端 未结 1 1245
-上瘾入骨i
-上瘾入骨i 2021-01-22 01:45

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

1条回答
  •  一整个雨季
    2021-01-22 02:41

    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

    0 讨论(0)
提交回复
热议问题