CLR SQL Server 2005 过程将存储过程结果作为参数

发布于 2024-09-15 03:34:52 字数 87 浏览 2 评论 0原文

我有一个存储过程,它返回一个行集,我想将其传递到 CLR 存储过程中以执行一些高级计算。

我该如何设置呢?接受输入?在 CLR 过程中迭代行集?

I have a stored procedure that returns a rowset that I'd like to pass into a CLR stored procedure to do some advanced calculations.

How would I set this up? Take the input? Iterate the rowset within the CLR procedure?

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

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

发布评论

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

评论(2

最好的办法是让 CLR 过程本身使用普通的 SqlCommand 执行存储过程,并像普通的 SqlDataReader 一样迭代结果。这是最好的方法,因为您可以避免结果的额外副本。

The best would be to have the CLR procedure execute the stored procedure itself, with an ordinary SqlCommand and iterate over the result as an ordinary SqlDataReader. This is the best way, since you avoid the extra copy of the result.

温柔一刀 2024-09-22 03:34:52

另一种选择是设置 SQLCLR 聚合函数。根据公式的结构,这可能是更自然的语法。

Another option would be to set up a SQLCLR Aggregate function. Depending on the structure of your formula, this might be a more natural syntax.

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