TSD00563 部署可能会遇到错误,因为它依赖于 [sys].[sp_executesql] 并且目标数据库中不存在
我遇到了一个非常烦人的问题。我们的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“您提到的问题是一个已知问题,我们已针对 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
使用一个 . [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!