1
Vote

Syntax error at Sql Server Paginating

description

hello i'm trying to apply paginating on ms sql server "SqlClient"



this is the generated sql string
SELECT [Persons].[ID], [Persons].[PersonName], [Persons].[PersonAge] FROM (
SELECT  ROW_NUMBER() OVER( 
        ORDER BY [Persons].[ID] ASC) AS _rowNum, [Persons].[ID], [Persons].[PersonName], [Persons].[PersonAge]
        FROM [Persons]) 
         AS _rowtable WHERE _rowNum BETWEEN 5 AND 14 
        ORDER BY [Persons].[ID] ASC
all tables & catalogs in the top "select" should be replaced with the alias "_rowtable"

comments