使用 ADO 和 OLE DB 实现具有递归 CTE 的内联表值函数
抱歉,我暂时无法提供缩减的数据案例。但这里有一个一般性问题。
自 SQL Server 2005 以来,我一直通过使用 ADO 和 OLE DB 的应用程序使用带有递归 CTE 的多语句表值函数,没有出现任何问题。 随着 SQL Server 2019 的出现,性能成为了一个问题。然后,我将该函数重写为内联表值函数,并在 SQL Server Management Studio 中使用时重新获得性能和功能。 在应用程序中使用时,使用此内联 TVF 第一次执行简单查询会返回空或关闭的记录集。在 atldbicli.h 中得到断言。同一查询的后续执行将返回正确的记录集。当我用值的静态选择语句替换 CTE 上的选择语句时,将填充记录集。
有什么线索吗?研究轴心、建议?提前致谢。
Apologies, I cannot provide a reduced data case for the moment. But here is a general question.
I have been using, since SQL Server 2005, thru an application using ADO with OLE DB, a Multi-Statements Table Value Function with Recursive CTE without problems.
With SQL Server 2019 performance became a problem. I then re-wrote the function as In-line Table Value Function and regain performance and functionality when used in SQL Server Management Studio.
When using in the application the first execution of a simple query with this In-line TVF returns an empty or closed recordset. got asserts in atldbicli.h. Subsequent executions of the same query return proper recordset. When I replace the select statement on the CTE by a static select statement of values, the recordset is being populated.
Any clue? axis of research , proposals? Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来我们使用的是过时版本的 ADO。
It appears we were using an outdated version of ADO.