xp iis asp+sql2k开发版:和茶壶一样,一切正常
win2k3 iis asp+sql2k标准版:一切正常
我的win2k3 iis asp+sql2k5企业版:就是首尾2条记录不正常
xp iis asp+sql2k5企业版:也是首尾2条记录不正常
好像焦点集中到了sql2k5!!!
--sql2k5直接执行left join肯定是没问题的
就是asp+ado连的时候,一个sql被转为多个命令,而且命令的条数居然是不一定的!!
【没有结果的:抓自sql2k5
declare @p1 int
set @p1=180150023
declare @p3 int
set @p3=1
declare @p4 int
set @p4=1
declare @p5 int
set @p5=1
exec sp_cursoropen @p1 output,N' select a.*,isnull(b.fprevid,-1) fprevid,isnull(c.fnextid,-2) fnextid from (SELECT * FROM tbInfo where fID=1 ) a left OUTER join
(select top 1 1 as fid,fid as fprevid from tbinfo where fid<1 order by fprevid desc) b on a.fid=b.fid left OUTER join (select top 1 1 as fid,fid as fnextid from
tbinfo where fid>1 order by fnextid) c on a.fid=c.fid ',@p3 output,@p4 output,@p5 output
select @p1, @p3, @p4, @p5
exec sp_cursorfetch 180150023,16,1,64
exec sp_cursorfetch 180150023,16,1,1
exec sp_cursorclose 180150023
】
【有结果的:抓自sql2k5
declare @p1 int
set @p1=180150013
declare @p3 int
set @p3=1
declare @p4 int
set @p4=1
declare @p5 int
set @p5=1
exec sp_cursoropen @p1 output,N' select a.*,isnull(b.fprevid,-1) fprevid,isnull(c.fnextid,-2) fnextid from (SELECT * FROM tbInfo where fID=2 ) a left OUTER join
(select top 1 2 as fid,fid as fprevid from tbinfo where fid<2 order by fprevid desc) b on a.fid=b.fid left OUTER join (select top 1 2 as fid,fid as fnextid from
tbinfo where fid>2 order by fnextid) c on a.fid=c.fid ',@p3 output,@p4 output,@p5 output
select @p1, @p3, @p4, @p5
exec sp_cursorfetch 180150013,16,1,64
exec sp_cursorfetch 180150013,16,2,64
exec sp_cursorfetch 180150013,16,1,1
exec sp_cursorclose 180150013
】
【正常的:抓自sql2k
declare @P1 int
set @P1=0
declare @P2 int
set @P2=98305
declare @P3 int
set @P3=98305
declare @P4 int
set @P4=0
exec sp_cursoropen @P1 output, N' select a.*,isnull(b.fprevid,-1) fprevid,isnull(c.fnextid,-2) fnextid from (SELECT * FROM tbInfo where fID=4 ) a
left OUTER join (select top 1 4 as fid,fid as fprevid from tbinfo where fid<4 order by fprevid desc) b on a.fid=b.fid left OUTER join (select top
1 4 as fid,fid as fnextid from tbinfo where fid>4 order by fnextid) c on a.fid=c.fid ', @P2 output, @P3 output, @P4 output
select @P1, @P2, @P3, @P4
declare @P1 int
set @P1=180150001
declare @P2 int
set @P2=8
declare @P3 int
set @P3=1
declare @P4 int
set @P4=1
exec sp_cursoropen @P1 output, N' select a.*,isnull(b.fprevid,-1) fprevid,isnull(c.fnextid,-2) fnextid from (SELECT * FROM tbInfo where fID=4 ) a
left OUTER join (select top 1 4 as fid,fid as fprevid from tbinfo where fid<4 order by fprevid desc) b on a.fid=b.fid left OUTER join (select top
1 4 as fid,fid as fnextid from tbinfo where fid>4 order by fnextid) c on a.fid=c.fid ', @P2 output, @P3 output, @P4 output
select @P1, @P2, @P3, @P4
exec sp_cursorfetch 180150001, 16, 1, 2
exec sp_cursorfetch 180150001, 16, 2, 2
exec sp_cursorfetch 180150001, 16, 1, 1
exec sp_cursorclose 180150001
】