简体   繁体   English

为什么在VS2008数据库项目中不运行部署后脚本?

[英]Why don't post-deployment scripts run in VS2008 database projects?

I've got a VS2008 database project, and I created a post-deployment script under Scripts > Post-Deployment, but it appears to be a no-op (even when I put syntax errors into the file, everything succeeds). 我有一个VS2008数据库项目,并在“脚本”>“部署后”下创建了一个部署后脚本,但它似乎是无操作的(即使将语法错误放入文件中,一切都成功了)。 The rest of the database deployment succeeds though (and it does create my tables). 不过,其余的数据库部署成功(并且确实创建了我的表)。 Any clues? 有什么线索吗?

It sounds like you're just placing scripts in your post-deployment directory. 听起来您只是将脚本放在部署后的目录中。 You actually need to include them in your Script.PostDeployment.sql file. 实际上,您实际上需要将它们包括在Script.PostDeployment.sql文件中。 For example: 例如:

:r .\MyScriptName.sql
:r .\MySecondScript.sql

Not every script in the Post-Deployment folder just runs by default; 并非默认情况下,Post-Deployment文件夹中的每个脚本都只运行。 in fact, only one can. 实际上,只有一个可以。 By default, it's that Script.PostDeployment.sql file. 默认情况下是Script.PostDeployment.sql文件。 You can change it if you want. 您可以根据需要进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM