title: SQL Server : print out cursor values
body: <p>I want to be able to print out or output the values from a cursor for my stored procedure's. I'm having a hard time trying to figure out how to do this. I need to output my values onto a sheet like a report about which customers have paid and which haven't. A comparison would be great.</p>
  
  <p>Here are my stored procedures for the customers who haven't paid:</p>
  
  <pre><code>CREATE PROC [dbo].[AdminReport1] 
  AS 
  BEGIN
      SELECT 
         booking.bookingID, booking.totalCost, 
         booking.bookingDate, booking.paymentConfirmation,
         customers.customersID, 
         customers.firstname, customers.surname,
         customers.contactNum
      FROM
         booking 
      INNER JOIN 
         customers ON booking.customerID = customers.customersID
      WHERE
         paymentConfirmation = 'False'
      ORDER BY 
         bookingDate ASC
  END
  GO
  </code></pre>
  
  <p>Here are my stored procedures for the customers who HAVE paid:</p>
  
  <pre><code>CREATE PROC [dbo].[AdminReport2] 
  AS 
  BEGIN
      SELECT 
         booking.bookingID, booking.totalCost, 
         booking.bookingDate, booking.paymentConfirmation,
         customers.customersID, 
         customers.firstname, customers.surname,
         customers.contactNum
      FROM
         booking 
      INNER JOIN 
         customers ON booking.customerID = customers.customersID
      WHERE
         paymentConfirmation = 'TRUE'
      ORDER BY 
         bookingDate ASC
  </code></pre>
  
  <p>So I need a cursor to print out my values. If anyone could help it would be much appreciated. An example with how to do this in code would be appreciated. </p>