ALTER PROCEDURE [dbo].[getData]
-- Add the parameters for the stored procedure here
@tb varchar(150),
@status nchar(2),
@indexpage int,
@endpage int
AS
declare @str varchar(200)
if @status is null
BEGIN
set @str=‘SELECT * FROM (SELECT ROW_NUMBER() OVER (order by T.ID desc)AS Row, T.* from ‘[email protected]+‘ T where Status=‘‘‘[email protected]+‘‘‘ ) TT WHERE TT.Row between ‘+str(@indexpage)+‘ and ‘+str(@endpage)
exec(@str)
END
else
BEGIN
set @str=‘SELECT * FROM (SELECT ROW_NUMBER() OVER (order by T.ID desc)AS Row, T.* from ‘[email protected]+‘ T ) TT WHERE TT.Row between ‘+str(@indexpage)+‘ and ‘+str(@endpage)
exec(@str)
END
时间: 2024-12-20 02:38:23