DECLARE @startRowIndex int
set @startRowIndex=0
Declare @maximumRows int
set @maximumRows=5
SET ROWCOUNT 5;
WITH OrderedEmployees As
SELECT *, ROW_NUMBER() OVER (Order By EmployeeID ASC) as RowNum FROM Employees
SELECT * FROM OrderedEmployees Where RowNum > @startRowIndex
Order By EmployeeID ASC
I got this query from a website but when I run it in SQL Server Management Studio, it gives me the following error please help me out, I have intuition that its just a syntax mistake that is stumping me here , please help me out
Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'SELECT'