VS 2010数据库项目有条件运行脚本
我是 VS 2010 数据库项目的新手,过去我使用过 dbp 项目,但 VS 2010 不再支持。
我想运行一组添加测试数据的 sql 脚本,但理想情况下只运行基于项目配置。
例如,如果我可以有一个 VS“测试”配置来执行这组脚本。
我当前正在使用 PostDeployment.sql 添加其他脚本以在部署后运行。
感谢您的任何帮助。
I am new to VS 2010 database projects, in the past I've used dbp projects but are not longer supported in VS 2010.
I would like to run a set of sql scripts that add test data, but would ideally like this to only run based on the project configuration.
For example, if I can have a VS "Test" configuration that would execute this set of scripts.
I am currently using the PostDeployment.sql to add other scripts to run on post deployment.
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要为项目设置变量,然后在构建/部署时引用它们。对于我们的例子,我们有一个“DeployType”变量,可以帮助我们在某些环境下运行某些脚本。
在部署后脚本中,您将使用类似以下内容的内容:
You'll want to set up variables for your project and then reference them when you do your build/deploy. For our case, we have a "DeployType" variable that can help us run certain scripts for certain environments.
In your post-deploy script, you'd use something like the following: