SQL Server query for paging
<p>I got simple SQL Server query:</p>

<pre><code>SELECT TOP 100 
    [ID], [SUMMARY], [NAME]   
FROM 
    [db_test].[dbschema].[dborders]
</code></pre>

<p>It works fine, and query 100 records from table, now for paging mechanism I need to get let's say 10 first records:</p>

<pre><code>SELECT TOP 10 
FROM 
    (SELECT TOP 100 
         [ID], [SUMMARY], [NAME]   
     FROM 
         [db_test].[dbschema].[dborders])
</code></pre>

<p>but I get an error:</p>

<blockquote>
  <p>Msg 156, Level 15, State 1, Line 1<br>
  Incorrect syntax near the keyword 'FROM'.</p>
</blockquote>

<p>Please tell me what I'm doing wrong, or give me example of correct statement.</p>