I want to set the result count of my query in SQL Server 2008. Something like Oracle’s rownum.
Is that even possible in SQL Server?
Peter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you mean that you only want, for example, the first 10 rows when there may be dozens or hundreds? If that is what you are seeking, you use
TOP.You just have to be careful of the sort order, if you care about it. Just like in Oracle.
And you might want only
DISTINCTrecords.