为什么我们不能从select语句调用存储过程 [英] why cant we call stored procedure from select statement
本文介绍了为什么我们不能从select语句调用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么我们不能从select语句中调用存储过程
why cant we call stored procedure from select statement
推荐答案
检查此链接是否有问题:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3cadb609-5f41-4fba-b2dc-ff0dc50da7db/how-to-call-stored-procedure-in- select-statement?forum = transactsql [ ^ ]
在选择查询中调用存储过程 [ ^ ]
http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server [ ^ ]
http://stackoverflow.com/questions/15575260/executing-stored-procedure-选择中查询 [ ^ ]
http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server [ ^ ]
最适合你的答案来自于此链接如下:
Check this links for your question:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3cadb609-5f41-4fba-b2dc-ff0dc50da7db/how-to-call-stored-procedure-in-select-statement?forum=transactsql[^]
Call a stored procedure in select query[^]
http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server[^]
http://stackoverflow.com/questions/15575260/executing-stored-procedure-in-select-query[^]
http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server[^]
The Best answer for you is from this link below :
You can use a User-defined function or a view instead of a procedure.
A procedure can return multiple result sets, each with its own schema. It's not suitable for using in a SELECT statement
http://stackoverflow.com/questions/1492411/sql-server-select-from-stored-procedure [ ^ ]
你可以这样做但是那里是不同的方式这样做
查看这个
how-to- use-openrowset-to-execute-a-stored-procedure-with-parameters [ ^ ]
所述-OPENROWSET-特技访问-存储过程-输出中一个选-statement.aspx 一> [ ^ ]
但不是性能的好选择
You can do that but there is different way to do that
check this
how-to-use-openrowset-to-execute-a-stored-procedure-with-parameters[^]
the-openrowset-trick-accessing-stored-procedure-output-in-a-select-statement.aspx[^]
but not a good option for performance
这篇关于为什么我们不能从select语句调用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文