TSD00563 部署可能会遇到错误,因为它依赖于 [sys].[sp_executesql] 并且目标数据库中不存在

发布于 2024-12-25 20:19:08 字数 433 浏览 3 评论 0原文

我遇到了一个非常烦人的问题。我们的 SPROC 之一是构建一段动态 SQL,然后使用 sp_executesql 执行它(请不要讨论构建用于执行的 SQL 字符串的问题)。

使用 Visual Studio 2010 数据库项目(又名 DataDude)进行架构比较和部署,我收到以下 SPROC 错误:

TSD00563 此部署在执行过程中可能会遇到错误,因为 [dbo].[MYSPROC] 依赖于 [sys].[sp_executesql] 并且目标数据库中不存在 [sys].[sp_executesql]

有谁知道我如何解决这个问题?

我有对主数据库架构文件的引用,但这没有什么区别。此外,它不是引用 master,而是引用 sys

非常感谢, 詹斯

I'm running into a very annoying issue. One of our SPROC is building up a dynamic bit of SQL which is then executed with sp_executesql (please let's not go into the issues with building up SQL strings for execution).

Using Visual Studio 2010 Database Project (aka. DataDude) to to schema comparisons and deployments and I'm getting the error below for the SPROC:

TSD00563 This deployment may encounter errors during execution because [dbo].[MYSPROC] depends on [sys].[sp_executesql] and [sys].[sp_executesql] does not exist in the target database

Does anyone know how I can get around this?

I have a reference to the master database schema file, but it makes no difference. Also, it's not referencing master, but sys instead.

Many thanks,
Jaans

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

得不到的就毁灭 2025-01-01 20:19:08

“您提到的问题是一个已知问题,我们已针对 RTM 修复了此问题。当您向 master .dbschema 文件添加数据库引用时,您需要确保数据库名称部分选择为文字并命名为“master””

<一个href="http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/68b0ce97-5275-42af-b213-bd456ce882d7" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/68b0ce97-5275-42af-b213-bd456ce882d7

"The issue you mentioned is a known issue, we had fixed this for RTM. And when you add a db reference to master .dbschema file, you need to make sure the database name part is choosed as literal and named "master""

http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/68b0ce97-5275-42af-b213-bd456ce882d7

青衫负雪 2025-01-01 20:19:08

使用一个 . [sys].[sp_executesql] 之前的前缀

这是一个示例
EXEC .sys.sp_executesql 'SELECT * FROM Table'

确实很奇怪!

Use a . prefix before the [sys].[sp_executesql]

Here's an example
EXEC .sys.sp_executesql 'SELECT * FROM Table'

Strange indeed!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文