如何使用 powershell 或任何其他工具从 .dacpac 文件(SSDT 项目)内部执行数据脚本?

发布于 2025-01-09 20:02:28 字数 407 浏览 5 评论 0原文

当我发布 SSDT 项目时,如附图所示,它会生成 .dacpac 文件。我想在发布 .dacpac 文件后从该 .dacpac 文件执行特定脚本。可以这样做吗?我的意思是是否可以访问该单独的脚本文件?如果是这样,我应该在 PowerShell 中使用什么方法和哪个工具/命令?

PS:我知道如何使用“SqlPackage.exe”和“发布配置文件”对数据库执行 .dacpac 文件。我想知道一种只执行单个脚本的方法,而不是表或存储过程。其他一切都很好。

输入图片此处描述

When I publish an SSDT project, as shown in the attached image, it generates the .dacpac file. From that .dacpac file, I want to execute a specific script after publishing the .dacpac. Is it possible to do so? I mean is it even possible to access that individual script file? If so, what is the way and which tool/command should I use in PowerShell?

PS: I know how to execute a .dacpac file against a database using a "SqlPackage.exe" and a "publish profile". I want to know a way to execute just an individual script, neither the tables nor the sprocs. Everything else works fine.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文