如何在 Windows 安装程序中使用 Visual Studio SQL 部署脚本
我们使用 Visual Studio 数据库项目来管理我们的数据库架构。我们希望将数据库部署的 .sql 输出包含在 InstallShield 中创建的产品安装程序中。
但是,当我们将sql脚本添加到InstallShield项目并运行安装程序时,安装程序无法运行该脚本。我们收到一个关于 :setvar(s) 的 OLEDB 错误,尽管我可以手动编辑 sql 脚本并修复它,但这并不是一个真正的长期解决方案。
We've used a Visual Studio database project to manage our database schema. What we would like to is include .sql output of a database deployment as part of our products installer which is being created in InstallShield.
However when we add the sql script to the InstallShield project and run the installer, the installer fails to run the script. We get an OLEDB error complaining about the :setvar(s), although I could edit the sql script manually and fix it this isn't really a long term solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
垃圾进垃圾出。 InstallShield 只是读取脚本并针对 OLEDB 连接执行它。您可以告诉它“错误中止”、“错误时转到下一个语句”或“错误时转到下一个脚本”。除此之外,事情就是这样。如果您的 SQL 有问题,则需要修复它们。
InstallShield可以对您的SQL进行搜索和替换处理。如果没有 SQL 示例,很难确切地说出要做什么,但请看一下:
使用InstallScript文本替换动态替换SQL脚本中的字符串
Garbage In Garbage Out. InstallShield just reads the scripts and executes it against an OLEDB connection. You can tell it On Error Abort, On Error Goto Next Statement or On Error Goto Next Script. Other then that it is what it is. If your SQL has problems they need to be fixed.
InstallShield can do search and replace processing on your SQL. Without a sample of your SQL it's difficult to say exactly what to do but take a look at:
Using InstallScript Text Substitution to Dynamically Replace Strings in SQL Scripts