I am creating a SQL Server query that will take a parameter and use that as the record number to return.
In pseudo code:
parameter returnCount
select top returnCount * from table where x = y
What is the correct syntax/code to perform that operation?
In SqlServer 2005 and up, do this:
For earlier versions, use:
https://web.archive.org/web/20210417081325/http://www.4guysfromrolla.com/webtech/070605-1.shtml for more information.