title: ORDER BY from MIN to MAX
body: <p>I'm new to SQL Server. I have a little problem and I can't look it up. The point is that I can't get the order of data in my column <code>STATEID</code>, I want to order it from min to max. I'm using the <code>ORDER BY</code> or <code>ASC</code> and it is not working. In what other way could I get the exact sequence min to max out of my column <code>STATEID</code>. I'm using SQL Server 2008. </p>
  
  <p>Here's an example of my code. </p>
  
  <pre><code>ALTER PROCEDURE [dbo].[basicGatherSelect]
      @StateID            nvarchar(5),    
      @Name               nvarchar(50)
  AS
  BEGIN 
      BEGIN TRANSACTION 
  
      SET NOCOUNT ON;
  
      SELECT  
         StateID, name
      FROM 
          tblState 
      ORDER BY 
          STATEID ASC
  
      IF  @@error &lt;&gt; 0
      BEGIN
              ROLLBACK
              RAISERROR ('PROBLEM', 16, 1)
              RETURN
      END
  
      COMMIT
  END
  </code></pre>
  
  <p>Results:</p>
  
  <ul>
  <li>10   Liban</li>
  <li>3    Rusia</li>
  <li>4    Letonija</li>
  <li>5    Austrija</li>
  <li>7    BARAZIL</li>
  <li>8    Njemacka</li>
  <li>9    Argentina</li>
  <li>1    Srbija</li>
  <li>2    Bosna</li>
  </ul>