在GetRecordFromPage(铁拳,sunjianhua_kki@sina.com)的基础上增加rowcount

来源:互联网 发布:汉诺塔问题 c语言 编辑:程序博客网 时间:2024/04/28 05:31

1、增加声明 @rowTotal  int output

2、实现下面方法

declare @strRowSQL nvarchar(4000)

if @strWhere != ''
set @strRowSQL = 'select @RowTotal=count(*) from ['
 + @tblName + '] where ' +  @strWhere
else 
set @strRowSQL = 'select @RowTotal=count(*) from ['
 + @tblName + '] '

EXEC sp_executesql @strRowSQL,N'@RowTotal INT OUT',@RowTotal OUT

原创粉丝点击