title: How to Limit # of Rows Returned using Openquery on a Linked Server
body: <p>I have an AS400 Linked Server, and I'm trying to run some queries and get some sample sets, but I can't figure out how to limit the number of rows returned.</p>
  
  <p>I tried:</p>
  
  <pre><code>SELECT * FROM OPENQUERY(LINKED, 'SELECT * FROM LINKED.APLUS.CUS WHERE CMSUSP != ''S'' LIMIT 100')
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT * FROM OPENQUERY(LINKED, 'SELECT TOP(100) * FROM LINKED.APLUS.CUS WHERE CMSUSP != ''S'' ')
  </code></pre>
  
  <p>I know I can add the TOP to the SELECT FROM OPENQUERY, but I'm trying to not have the AS400 return 100k rows when I only need 100.</p>