在SQL CTE中调用存储过程 [英] Call a Stored procedure in SQL CTE
本文介绍了在SQL CTE中调用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否允许在SQL CTE语句中执行存储过程?我对sql cte查询有点陌生...
Are you allowed to exec stored procedures within a SQL CTE statement? I'm a bit new to sql cte queries...
推荐答案
不,抱歉。仅用于SELECT语句
No, sorry. SELECTs statments only
如果您需要使用存储的proc输出(结果集),那么它将是一个临时表
If you need to use stored proc output (result set), then it'd be a temp table
CREATE TABLE #foo (bar int...)
INSERT #foo (bar, ...)
EXEC myStoredProc @param1...
-- more code using #foo
这篇关于在SQL CTE中调用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文