title: Sql Server query varchar data sort like int
body: <p>I have one table like </p>
  
  <pre><code>CREATE TABLE table_name
  (
  P_Id int,
  amount varchar(50)
  )
  </code></pre>
  
  <p>Data Like </p>
  
  <pre><code>Id amount
  ----------
  1 2340
  2 4568
  3 10000
  </code></pre>
  
  <p>Now I want to sort table by amount but one problem is amount is varchar so it sort table like this </p>
  
  <pre><code>Id amount
  ----------
  3 10000
  1 2340
  2 4568
  </code></pre>
  
  <p>but i want result like this </p>
  
  <pre><code>Id amount
  ----------
  3 10000
  2 4568
  1 2340
  </code></pre>
  
  <p>what should i do ?</p>