How can I script the deployment of a Visual Studio database project?

血红的双手。 提交于 2019-12-03 15:15:27
MSBuild /target:SQLBuild MyProjectName.dbproj

Performs a build-only action. It builds only a single database project named MyProjectName.dbproj. The project properties within the .dbproj file are used to assemble the build script.

MSBuild /target:Deploy /property:TargetDatabase=UpdatedTargetDatabase;TargetConnectionString="Data Source=(local)\SQLEXPRESS;Integrated Security=True;Pooling=False" MyProjectName.dbproj

Deploys the database project, overriding the target database name and connection string.

For me in Vs2010, this one produced the file

MSBuild /target:Deploy MyProjectName.dbproj

another option is

MSBuild /target:Build;Deploy MyProjectName.dbproj

additional information found at http://ishan-patel.blogspot.com/2012/04/create-single-database-deployment.html

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