1
set ANSI_NULLS ON2
set QUOTED_IDENTIFIER ON3
go4
--根据类别编号获取类别5

6

7

8
create procedure P_GetListByTypeID9
(@startIndex int,10
@endIndex int,11
@Product_Type int12
)13
as14
set nocount on15
declare @indextable table(id int identity(1,1),nid int)16
set rowcount @endIndex17
insert into @indextable(nid) select Product_ID from Product where Product_Type=@Product_Type order by Product_ID desc18

19
select * FROM Product A 20
inner join @indextable t on A.Product_ID=t.nid 21
where Product_Type=@Product_Type and t.id between @startIndex and @endIndex order by t.id22

23
set nocount off24
RETURN25

26

27

28

29

30

31

32

33
