title: SQL Server Stored Procedure to return multiple rows
body: <p>I need a stored procedure to return 10 rows of data to display an a page from the newest to the oldest data. I also need to get the next 10 rows and then the next 20 if the user hits a next or previous button. I know how to get one row at a time as I have below but am not sure how to return multiple rows.</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[spGetRow] 
      @RowIdent int,
      @Formula varchar(5) output,
      @Batch# int output,
      @Status int output,
      @AutoMode int output,
      @Time datetime output,
      @Mixer varchar(3) output,
      @QCTech varchar(3) output,
      @Notes varchar(max) output,
      @Deck int output,
      @Ident int output
  AS
  BEGIN
      SET NOCOUNT ON;
  
      SELECT 
         @Formula = [Formula],
         @Batch# = [Batch#],
         @Status= [Status],
         @AutoMode = [AutoMode],
         @Time = [Time],
         @Mixer = [Mixer],
         @QCTech = [QCTech],
         @Deck = [Notes],
         @Deck = [Deck],
         @Ident= [Ident]
    FROM [VenturaQC].[dbo].[QCLog] 
    WHERE
         [Ident] = @RowIdent
  
    Return 1
  END
  </code></pre>
  
  <p>Sample QCLog table</p>
  
  <pre><code>Formula Batch#  Status  AutoMode    Time        Mixer   QCTech  Notes   Deck    Ident
  F1235   1   2   1   2014-01-12 00:00:00.000 abc AT  Note 1  2   2
  F1235   1   2   2   2014-01-12 00:00:00.000 abc AT  Note 2  2   3
  F7175   1   1   1   2014-01-12 00:00:00.000 JH  EC  20#VIN. PER 5000#BATCH SIZE 5   6
  F7175   1   2   1   2014-01-12 00:00:00.000 JH  KT  20#vin Resample 5   7
  F7610   4   1   1   2014-01-12 00:00:00.000 JH  ec      6   8
  F7610   4   5   1   2014-01-12 00:00:00.000 JH  KT      6   9
  </code></pre>
  
  <p>Thanks in advance
  Kenny</p>