易截截图软件、单文件、免安装、纯绿色、仅160KB

不是拼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


相关文档:

SQL*Plus FAQ

 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 ......

SQL Server——删除数据库日志

一、清空日志
DUMP   TRANSACTION   库名   WITH  
NO_LOG    
二、收缩数据库文件(如果不压缩,数据库的文件不会减小
企业管理器--右键你要压缩的数据库--所有任务--收缩数据库--收缩文件
  
--选择日志文件--在收缩方式里选择收缩至XXM,这 ......

SQL server不能远程连接

这段时间碰到一个很奇怪的问题:SQL server不能远程连接。命名管道和TCP/IP协议都已启用,防火墙也关闭了等等,但就是不能远程连接数据库。终于找到原因了,当输入数据库服务器实例名时应:\,, 平常一般不用附加端口号的。 ......

关于时间段的SQL(Orcale、SQL Server)查询

一、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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号