title: Incorrect syntax near 'CAST' in sql server
body: <p>I have a table pin_mst below</p>
  
  <p><img src="https://i.stack.imgur.com/hywt0.gif" alt="enter image description here"></p>
  
  <p>but the following query is showing error</p>
  
  <pre><code>Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'CAST'.
  </code></pre>
  
  <p>.. plz help.</p>
  
  <pre><code>SELECT TOP CAST(1 AS VARCHAR(3)) PIN_ID from pin_mst
  </code></pre>