使用 ADO 和 OLE DB 实现具有递归 CTE 的内联表值函数

发布于 2025-01-15 11:18:47 字数 363 浏览 4 评论 0原文

抱歉,我暂时无法提供缩减的​​数据案例。但这里有一个一般性问题。

自 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 技术交流群。

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

发布评论

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

评论(1

浪漫之都 2025-01-22 11:18:47

看来我们使用的是过时版本的 ADO。

It appears we were using an outdated version of ADO.

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