一个存储过程问题
ALTER PROCEDURE [dbo].[a_Example]
@startIndex INT,
@pageSize INT
AS
begin
select count(InOutBedID) as RecordCountID from InOut_InOut_InOutBed
end
begin
WITH orderList AS
(
SELECT *,row_number() OVER (ORDER BY InOutBedID DESC)AS Row
from InOut_InOut_InOutBed
)
SELECT *
FROM orderlist
WHERE row between @startIndex and @startIndex+@pageSize-1
end
这个存储过程
select count(InOutBedID) as RecordCountID from InOut_InOut_InOutBed
是统计个数
下面的是分页
返回的是2个表
怎么把统计的个数也存到orderList视图中
然后返回结果是一个表?
[解决办法]
统计的个数你可以用输出参数或者返回值
[解决办法]
存储过程加个参数 @count output最后select @count = count(InOutBedID) as RecordCountID from InOut_InOut_InOutBed
[解决办法]
用output型参数输入单个值.
[解决办法]
同意楼上的
把一个作为输出参数