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 语句,
看这里貌似有创建表。。那在页面里面该如何弄呢。。
谢谢!
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 语句,
看这里貌似有创建表。。那在页面里面该如何弄呢。。
谢谢!
2、set rowcount也是没有的。
----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
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]
这样不行 t.nid nid 从哪里来呢?