declare @indextable table(id int identity(1,1),nid int)
set rowcount @endIndex
insert into @indextable(nid) select ID from Product  order by ID desc
select * from Product O,@indextable t where O.ID=t.nid
and t.id between @startIndex and @endIndex order by t.id本来是SQL的存储过程,可是我现在用ACCESS ,所以就没存储过程了
我现在需要把这个存储过程转化为 页面后台程序里面的 SQL 语句,
看这里貌似有创建表。。那在页面里面该如何弄呢。。
谢谢!

解决方案 »

  1.   

    1、变量表,ACCESS是没有的。
    2、set rowcount也是没有的。
      

  2.   


    ----tryset rowcount @endIndex select * from Product O,
    (select top(@endIndex) ID from Product  order by ID desc )
    t where O.ID=t.nid 
    and t.id between @startIndex and @endIndex order by t.id 
      

  3.   

    是呀。。ACCESS 没处处过程,所以我要写到页面里去,但不知道如何把这个存储过程转化。。
      

  4.   

    [code]
    select * from Product O,
    (select top(@endIndex) ID from Product  order by ID desc )
    t where O.ID=t.nid 
    and t.id between @startIndex and @endIndex order by t.id 
    [/code]
      

  5.   


    这样不行 t.nid nid 从哪里来呢?