title: SQL Server : how to use select top (@number) syntax?
body: <p>Suppose I have a SQL Server <code>employee</code> table as follows:</p>
  
  <pre><code>No   empno
  -----------
  1    NULL
  2    7889
  3    7778
  4    6454
  5    7777
  </code></pre>
  
  <p>I want to select row 3</p>
  
  <pre><code>SET @count = 3 
  
  SELECT TOP (@count) empno 
  FROM employee 
  EXCEPT 
  SELECT TOP (@count-1) empno 
  FROM employee
  </code></pre>
  
  <p>I get an error at <code>@count</code>:</p>
  
  <blockquote>
    <p>Must declare the scalar variable @count</p>
  </blockquote>
  
  <p>How can I fix this statement?</p>
  
  <p>By the way, I use Microsoft SQL Server Management Studio and they don't have <code>SELECT ROW</code>?</p>