Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2007, 20:07
programadorvip
 
Fecha de Ingreso: agosto-2006
Ubicación: en lima peru
Mensajes: 184
Antigüedad: 17 años, 8 meses
Puntos: 0
Sonrisa Problema con Paginacion en sql server 2005

hola tengo el siguiente store

Código PHP:
alter PROCEDURE  Usp_Listar_HI_Paginar
@PageSize int
@
PageNumber int 
as
SELECT Gender,
HealthIssueid,
NickName
Age
,
Location,
Specialty
Date,
Subject,
Symptoms
from 
(SELECT   dbo.Patient.Gender,
lower(HealthIssue.HealthIssueid) as HealthIssueid
lower(dbo.Patient.NickName) as  NickName,
YEAR(GETDATE()) - YEAR(dbo.Patient.Birthday) AS Age,
lower(dbo.Patient.MailingCity '    ' dbo.Patient.MailingCountry)AS Location,
lower(dbo.Specialty.SpecialtyName) AS Specialty
CONVERT(VARCHAR(10),dbo.HealthIssue.CreationDate,103) AS Date,
lowerdbo.HealthIssue.Subject)  as Subject,
lower(dbo.HealthIssue.Symptoms) as Symptoms,
ROW_NUMBER() OVER (ORDER BY HealthIssueid ,NickName asc) AS RowNumber 
FROM         dbo
.HealthIssue INNER JOIN
                      dbo
.Patient ON dbo.HealthIssue.PatientId dbo.Patient.PatientId INNER JOIN
                      dbo
.Specialty ON dbo.HealthIssue.SpecialtyId dbo.Specialty.SpecialtyId
  
) as HealthIssue
WHERE RowNumber BETWEEN 
@PageSize * @PageNumber 
AND @PageSize * (@PageNumber 1
y cuando lo ejecuto solo me trae un registro y no me funciona el paginado, estare cometiendo algun horror!! o es una limitacion del sql ??


Código PHP:
exec  Usp_Listar_HI_Paginar 10,
solo me trae un registro y en ese inner join hay mas de 1000 registros cual e