在SQL Server中运行存储过程 [英] Run a storeprocedure in sql server

查看:78
本文介绍了在SQL Server中运行存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有什么办法可以像这样进行搜索吗?

Hi guys,

Is there any way to do search like this?

select COUNT(*)
from (exec spCouponRedemptionsReports @StartDate = '8/8/11', @EndDate = '9/9/11', @SearchKey = 'Gold')


我的存储过程返回10个字段.

请提供帮助,在此先谢谢您.


My stored procedure return 10 fields.

Please help, thanks in advance.

推荐答案

您不能在这样的select语句中使用存储过程.

但是,您可以创建一个表值函数并使用它.例如,请参见:在SQL Server中使用表值函数 [
You cannot use stored procedure in a select statement like that.

However, you can create a table valued function and use that. For example see: Using Table-Valued Functions in SQL Server[^]


这篇关于在SQL Server中运行存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆