注册 登录
编程论坛 SQL Server论坛

还是存储过程

tokoyoshi 发布于 2010-04-14 11:22, 528 次点击
ALTER proc [dbo].[QuestionInfo_count]
@id int
as
select top 1 *from QuestionInfo where CategoryID=@id order by ReleaseTime desc

我以为这样会返回结果集,结果程序报错,说返回int,怎么让它返回结果集,谢谢
3 回复
#2
cnfarer2010-04-14 21:04
存储过程返回值,通常是存储过程的执行状态。你要得到的是结果集,而不是返回值!
#3
czyzhuo2010-04-15 09:04
你写的这个存储过程没错,直接执行它就得到 一个结果集了
exec QuestionInfo_count @id=??
#4
boblibra2010-04-15 11:02
存储过程有问题,参数的问题。输出的参数要用output
1