The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Paging support and ROW_NUMBER() function in SQL Server 2005

Last post 04-23-2007, 10:40 AM by Mike.Griffin. 1 replies.
Sort Posts: Previous Next
  •  04-23-2007, 9:59 AM 1974

    Paging support and ROW_NUMBER() function in SQL Server 2005

    Guys,

    Seems as if the query built by Entity spaces when Paging is being relied upon assumes that ROW_NUMBER() is zero based, whereas, according to the Transact-SQL reference, it is 1- based:

    Returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.

    See an example es.LastQuery taken from a debugging session: The first load asks for rows 0 thru 14 for when PageNumber is 0 and PageSize is 15: 

    LastQuery = "WITH [withStatement] AS (SELECT *, ROW_NUMBER() OVER( ORDER BY [Name] ASC) AS ESRN FROM [Golf].[dbo].[Union]) SELECT * FROM [withStatement] WHERE ESRN BETWEEN 0 AND 14"

    Am I correct in pointing this out as a possible problem?

    Regards

     

     

     


    Leon
  •  04-23-2007, 10:40 AM 1975 in reply to 1974

    Re: Paging support and ROW_NUMBER() function in SQL Server 2005

    Probably a bug on our part. I am busy adding Paging and some other things to our esDataSource for our next beta. I will make sure this is correct. Thank you.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML