年前最后一节课的代码

来源:互联网 发布:draw9patch mac版 编辑:程序博客网 时间:2024/05/01 03:07
create procedure usp_getPageList@pageIndex int,@pageSize int,@totalRecords int out,@totalPages int outas select * from(select *,ROW_NUMBER() over(order by studentno) as myidfrom student)as tempwhere myid between (@pageIndex-1)*@pageSize+1 and @pageIndex*@pageSize--求出总记录数select @totalRecords=COUNT(1) from student--优化方案set @totalPages=ceiling(@totalRecords*0.1/@pageSize)declare @record intdeclare @page intexec usp_getPageList 2,3,@record out,@page outprint @recordprint @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

0 0
原创粉丝点击