是否可以在忽略 SELECT 语句的同时执行具有输出参数的 T

编程入门 行业动态 更新时间:2024-10-28 19:34:04
本文介绍了是否可以在忽略 SELECT 语句的同时执行具有输出参数的 T-SQL 存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在从另一个存储过程调用一个存储过程,并且我正在调用的过程有一个输出参数.然后我将输出值通过管道传输到局部变量中.这一切都很好,但问题是这个过程也有一个select语句,所以当我exec时,过程的结果在返回最终结果集.

I am calling one stored procedure from another, and the procedure I am calling has an output parameter. I am then piping the output value into a local variable. That's all well and good, but the problem is that this procedure also has a select statement in it, so when I exec, the results of the procedure are being returned in the final results set.

有没有办法简单地获取输出参数的值,而忽略其他所有内容?

Is there a way to simply get the value of the output parameter, and ignore everything else?

推荐答案

虽然从技术上讲是的,但你不应该这样做.引擎消耗资源来生成您忽略的结果集.您还可能会产生不必要的争用.如果您不需要结果集,则需要另一个过程来只产生您想要的输出.

While technically yes, you shouldn't do it. The engine consumes resources to produce the result set you ignore. You may also produce unnecessary contention. If you don't need the result set, you need another procedure that should only produce the output you desire.

这篇关于是否可以在忽略 SELECT 语句的同时执行具有输出参数的 T-SQL 存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 20:15:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1195233.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语句   参数   SELECT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!