为什么 SQL 2005 在传递 sqlxml 参数时调用 CONVERT?
我声明一个 SqlXml 参数并向其传递一个 XmlReader。 然后它被参数化并且 SQL 得到很好的执行。 但是,当查看通过探查器执行的 SQL 时,我注意到它采用 SqlXml 参数并对其调用 CONVERT...
CONVERT (xml, )
为什么服务器需要调用 CONVERT,我已经将其传递为有效xml? 是因为我没有定义架构吗?
我怀疑这会导致该查询性能不佳。 任何帮助都会很棒。
干杯
I am declaring an SqlXml param and passing it a XmlReader. This then gets parametrized and the SQL gets executed all very well. However, when looking at the SQL which gets executed through profiler I notice that it is taking the SqlXml parameter and calling CONVERT on it...
CONVERT (xml, )
Why does the server need to call CONVERT, I've already passed it valid xml? Is it because I'm not defining a schema?
I suspect this is causing bad performance on this query. Any help would be fantastic.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当执行该函数时,SQL Server 在将其传递给函数之前调用 CONVERT (xml, '')。 所以看起来它作为字符串传递到 SQL Server,即使我已将其声明为 SqlXml...我希望它作为 xml 传递到 SQL Server 并且不需要转换?
干杯
When this gets executed, SQL Server calls CONVERT (xml, '') before passing it to the function. So it looks like it gets passed as a string to SQL Server even though I've declared it as SqlXml... I would have expected it to be passed to SQL Server as xml and not conversion would be needed?
Cheers