存储过程分页怎么取到存储过程的返回值?
我的存储过程是这样的!
CREATE PROCEDURE proTest
@strSql as nvarchar(2000) = null, --要查询语句如 Select top 30 * from orders
@startRow as int = null, --从其开始的从零开始的记录号
@maxRows as int = null --要检索的最大记录数
AS
DECLARE @stopRow as int
set @stopRow = @startRow + @maxRows
set @strSql = N' Select top ' + CAST(@StopRow as nvarchar(9)) + '*, IDENTITY(int,1,1) AS TempIDKey_Num '
+ ' INTO #New_Table '
+ ' FROM( ' + @strSql + ') A '
+ ' Select * From #New_Table Where TempIDKey_Num>=' + CAST(@StartRow as nvarchar(9))
+ ' DROP TABLE #New_Table '
execute sp_executesql @strSql
GO
怎么取到他的返回记录数、当前页码
CREATE PROCEDURE proTest
@strSql as nvarchar(2000) = null, --要查询语句如 Select top 30 * from orders
@startRow as int = null, --从其开始的从零开始的记录号
@maxRows as int = null --要检索的最大记录数
AS
DECLARE @stopRow as int
set @stopRow = @startRow + @maxRows
set @strSql = N' Select top ' + CAST(@StopRow as nvarchar(9)) + '*, IDENTITY(int,1,1) AS TempIDKey_Num '
+ ' INTO #New_Table '
+ ' FROM( ' + @strSql + ') A '
+ ' Select * From #New_Table Where TempIDKey_Num>=' + CAST(@StartRow as nvarchar(9))
+ ' DROP TABLE #New_Table '
execute sp_executesql @strSql
GO
怎么取到他的返回记录数、当前页码
...全文
相关推荐
Sql Server 存储过程调用存储过程接收输出参数返回值
主要介绍了Sql Server 存储过程调用存储过程接收输出参数返回值,需要的朋友可以参考下
mysql存储过程 在动态SQL内获取返回值的方法详解
本篇文章是对mysql存储过程在动态SQL内获取返回值进行了详细的分析介绍,需要的朋友参考下
.Net 调用存储过程取到return的返回值
存储过程只能返回 int 类型,如果返回一个字符串 ,将会报类型转化错误,下面以示例介绍下如何取到return的值,需要的朋友可以参考下
mysql存储过程实现分页
mysql存储过程实现分页 mysql存储过程实现分页 mysql存储过程实现分页 mysql存储过程实现分页
Mysql带返回值与不带返回值的2种存储过程写法
过程1:带返回值: drop procedure if exists proc_addNum; create procedure proc_addNum (in x int,in y int,out sum int) BEGIN SET sum= x + y; end 然后,执行过程,out输出返回值: call proc_addNum(2,3,@sum); select @sum; 过程2:不带返回值: drop procedure if exists proc_addNum; create procedure proc_addNum (in x int,in y in


