title: Which solution is better for getting random record set from db?
body: <p>I want to get some random records from db. There is two solution for this :</p>
  
  <p>1- Using <code>TABLESAMPLE</code> for getting data from db directly.</p>
  
  <p>2- Write a method In my application for doing this. In this method we generate multiple random number and get data like this :</p>
  
  <pre><code>select * from db where ID = @RandomNumber
  </code></pre>
  
  <p>if this ID does not exist, I pass a new number.</p>
  
  <p>Now which one has better performance?</p>