年前最后一节课的代码
2017-02-05 15:18
337 查看
create procedure usp_getPageList @pageIndex int, @pageSize int, @totalRecords int out, @totalPages int out as select * from ( select *,ROW_NUMBER() over(order by studentno) as myid from student )as temp where myid between (@pageIndex-1)*@pageSize+1 and @pageIndex*@pageSize --求出总记录数 select @totalRecords=COUNT(1) from student --优化方案 set @totalPages=ceiling(@totalRecords*0.1/@pageSize) declare @record int declare @page int exec usp_getPageList 2,3,@record out,@page out print @record print @page --------------------------------------------------- -------------------------存储过程-------------- --系统存储过程 说明 --sp_databases -- 列出说明上是所有服务器 exec sp_databases --sp_helpdb 报告有关指定数据库或所有数据库的信息 sp_helpdb --sp_renamedb 更改数据库名称 sp_renamedb MySchool,School --sp_tables 返回当前环境下可查询的对象的列表 sp_tables --sp_help 查看某个表的所有信息 sp_help subject --sp_helpconstraint 查看某个表的约束 sp_helpconstraint student --sp_helpindex 查看某个表的索引 sp_helpindex student --sp_stored_procedures 列出当前环境中的所有存储过程 sp_stored_procedures --sp_password 添加或修改登录账户的密码 sp_password null,'000000','ss' --sp_helptext 显示默认值,未加密的存储过程,用户定义的存储过程,触发器或视图的实际文本 sp_helptext vw_student
相关文章推荐
- c#复制文件
- 读读MaNGOS系列之总览
- spring maven 搭建dubbo框架 服务端
- c#画平行线和垂线的代码
- C++如何设计一个不含指针的类 (Boolan笔记第一周)
- java IO总结之文件
- laravel-admin安装完整教程laravel5.2版
- springmvc基础篇—使用注解方式为前台提供数据
- C++ std::unordered_multimap
- MyEclipse2016的安装破解
- python带颜色输出
- 初学PHP 之 简介
- ALGO-95 2的次幂表示 蓝桥杯
- eclipse maven install子模块报错无法找到父模块的class
- java千万级别数据处理-千万级别FTP下载
- 《Spring实战》学习笔记(三)面向切面的Spring
- python oop面向对象笔记
- javax.servlet.ServletException: Could not resolve view with name 'xxxxx'in servlet with name 'xxx'
- Struts2+Ueditor配置和图片上传
- spring下载dist.zip的几种方式