我爱Aspx >> Asp.Net >> 存储过程分页--如果显示第一页,可以直接用top来完成
if @PageCurrent=1
begin
select @Id1=cast(@PageSize as varchar(20))
exec('select top '+@Id1+@FdShow+' from '+@QueryStr+@FdOrder)
return
end
--如果是表,则检查表中是否有标识更或主键
if @Obj_ID is not null and objectproperty(@Obj_ID,'IsTable')=1
begin
select @Id1=cast(@PageSize as varchar(20))
,@Id2=cast((@PageCurrent-1)*@PageSize as varchar(20))
select @FdName=name from syscolumns where id=@Obj_ID and status=0x80
if @@rowcount=0 --如果表中无标识列,则检查表中是否有主键
begin
if not exists(select 1 from sysobjects where parent_obj=@Obj_ID and xtype='PK')
goto lbusetemp --如果表中无主键,则用临时表处理
select @FdName=name from syscolumns where id=@Obj_ID and colid in(
select colid from sysindexkeys where @Obj_ID=id and indid in(
select indid from sysindexes where @Obj_ID=id and name in(
Ҷƪл˵?
SQL在存储过程中使用递归[05-20]
如何获取 IP 用户名 等信息[05-20]
UTF-8 and Unicode FAQ[05-20]
使用ICallbackEventHandler接口实..[05-20]
不用.net和其组件用asp访问webse..[05-20]
PageTemplate(页模板)[05-20]
ASP.NET 页面对象模型[05-20]
ADO.NET中的多数据表操作之读取[05-20]
ASP.NET里的事务处理[05-20]
ASP.NET中使用Caching[05-20]