sqlserver2000 分页存储过程 出错问题
create procedure pagination
(
@startIndex int,
@endIndex int,
@docount bit,
@tableName varchar(50),
@order varchar(50),
@where varchar(1000)
)
as
set nocount on
if(@docount=1)
select count(*) from "+@tableName+"
else
begin
declare @indextable table(id int identity(1,1),nid int)
set rowcount @endIndex
insert into @indextable(nid) select * from "+@tableName+" order by "+@order+"
select * from "+@tableName+" o,@indextable t where "+@where+"
and t.id between @startIndex and @endIndex order by t.id
end
以上是我用分页控件生成的存储过程,但是我改过之后,就出现问题了,不知道为什么出错,哪位大虾帮我看下!
set nocount off
(
@startIndex int,
@endIndex int,
@docount bit,
@tableName varchar(50),
@order varchar(50),
@where varchar(1000)
)
as
set nocount on
if(@docount=1)
select count(*) from "+@tableName+"
else
begin
declare @indextable table(id int identity(1,1),nid int)
set rowcount @endIndex
insert into @indextable(nid) select * from "+@tableName+" order by "+@order+"
select * from "+@tableName+" o,@indextable t where "+@where+"
and t.id between @startIndex and @endIndex order by t.id
end
以上是我用分页控件生成的存储过程,但是我改过之后,就出现问题了,不知道为什么出错,哪位大虾帮我看下!
set nocount off
...全文
相关推荐
MSSQL 2000 语法 分页 函数 存储过程
MSSQL最全语法 分页 函数 存储过程 触发器
[MSSQL]SQL Server2000存储过程调试
今天写了个存储过程,在查询分析器中测试报错: 这样的错误信息根本看不出错在哪边,只能用单步执行来追踪了。在查询分析器对象浏览器中找到要调试的存储过程,右键点击选择调试: 输入各个参数的值后开始调试(钩选自动回滚调试完毕后将回滚操作): 按F11单步执行: 终于找到错误的位置了: 修改存储过程,输出@strSQL的值,才发现原来是声明的时候设置@strSQL的长度为300,而拼接的SQL语句
SQLServer2000驱动jar包
java连接SQLServer2000数据库,用这个驱动,必须的。
MSSQL MySQL 数据库分页(存储过程)
先看看单条 SQL 语句的分页 SQL 吧。 方法1: 适用于 SQL Server 2000/2005 代码如下: SELECT TOP 页大小 * FROM table1 WHERE id NOT IN ( SELECT TOP 页大小*(页数-1) id FROM table1 ORDER BY id ) ORDER BY id 方法2: 适用于 SQL Server 2000/2005 代码如下: SELECT TOP 页大小 * FROM table1 WHERE id > ( SELECT ISNULL(MAX(id),0) FROM ( SELECT TOP 页大小*(页数
jdbc分页实例sqlserver2000
jdbc 分页实例,含PPT分页课程详解及源代码。


