Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » SQL Server »

Problema con Paginacion en sql server 2005

Estas en el tema de Problema con Paginacion en sql server 2005 en el foro de SQL Server en Foros del Web. 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 ,  ...
  #1 (permalink)  
Antiguo 25/09/2007, 20:07
 
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
  #2 (permalink)  
Antiguo 25/09/2007, 20:19
 
Fecha de Ingreso: agosto-2006
Ubicación: en lima peru
Mensajes: 184
Antigüedad: 17 años, 8 meses
Puntos: 0
Re: Problema con Paginacion en sql server 2005

pues el problema se soluciono creando una vista y llamandolo al store... nose como el sql server no puede trabajar sin la vista pero bueno

Código PHP:
create  PROCEDURE  Usp_Listar_HI_Paginar
@PageSize int
@
PageNumber int 
as
SELECT Gender,
HealthIssueid,
NickName,
Age,
Location,
Specialty
Date,
Subject,
Symptoms
from 
(SELECT  Gender,
HealthIssueid,
NickName,
Age,
Location,
Specialty
Date,
Subject,
Symptoms,
ROW_NUMBER() OVER (ORDER BY HealthIssueid ,NickName asc) AS RowNumber 
FROM        dbo
.HelathIssueView
  
) as HealthIssue
WHERE RowNumber BETWEEN 
@PageSize * @PageNumber 
AND @PageSize * (@PageNumber 1

[PHP]exec Usp_Listar_HI_Paginar 10,0[PHP]
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:21.