不是拼SQL语句的页面存储过程
ALTER PROCEDURE [dbo].[GetUsersList]
@BigClassID int=0,--大类别ID
@SmallClassID int=0 ,--小类别ID
@pageindex int=1,
@pagesize int=3,
@ret int output --共几条
AS
set rowcount @pagesize
if @SmallClassID>0
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,rank() over(order by id desc) as rownumber from Users where BigClassID=@BigClassID and SmallClassID=@SmallClassID
)t where t.rownumber>(@pageindex-1)*@pagesize;
set @ret=(select count(id) from Users where BigClassID=@BigClassID and SmallClassID=@SmallClassID);
end
else
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,rank() over(order by id desc) as rownumber from Users
)t where t.rownumber>(@pageindex-1)*@pagesize;
set @ret=(select count(id) from Users) ;
end
相关文档:
What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers ......
一、清空日志
DUMP TRANSACTION 库名 WITH
NO_LOG
二、收缩数据库文件(如果不压缩,数据库的文件不会减小
企业管理器--右键你要压缩的数据库--所有任务--收缩数据库--收缩文件
--选择日志文件--在收缩方式里选择收缩至XXM,这 ......
这段时间碰到一个很奇怪的问题:SQL server不能远程连接。命名管道和TCP/IP协议都已启用,防火墙也关闭了等等,但就是不能远程连接数据库。终于找到原因了,当输入数据库服务器实例名时应:\,, 平常一般不用附加端口号的。 ......
一、Orcale 时的查询
String hql = "from SmsTemplate t where 1=1 ";
if (model != null && !"".equals(model.getEndTimes())&& null!=model.getEndTimes() ) {
SimpleDateFormat dateFm = new SimpleDateFormat("yyyy-MM-dd"); //格式化当前系统日期
Date ......