I'm listing questions with this
SELECT q.qTitle, q.qDescription, q.qCreatedOn, u.uCode, u.uFullname, qcat.qcatTitle, q.qId, q.qStatus
FROM tblQuestion AS q INNER JOIN tblUser AS u
ON q.uId = u.uId INNER JOIN tblQuestionCategory AS qcat
ON q.qcatId = qcat.qcatId
WHERE (q.qStatus = 1)
ORDER BY q.qCreatedOn DESC
OFFSET @page*10 ROWS FETCH NEXT 10 ROWS ONLY
But there is a problem in my server,
Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
How can I modify my query for sql server 2008?
One more question. How can I write a stored procedure for listing pages? Here is my full of code http://codepaste.net/gq5n6c
Answer: http://codepaste.net/jjrkqr
(@page*10)
might resolve it. If not, look into the docs to see the formal syntax. – Forenoon