title: Select and update in one stored procedure
body: <p>I have a select stored procedure and I am trying to make it so the results it bring down it also updates a column called <code>Downloaded</code> and marks those rows as downloads. </p>
  
  <p>For example, I pull down 10 rows those 10 rows I also want to update the <code>Downloaded</code> column to true all in the same stored procedure. Is this possible? </p>
  
  <p>This is my sp so far, it pulls down the data.</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[GetLeads]
  @DateTo datetime = null,
  @DateFrom datetime = null
  AS
      SELECT name
           , lastname
           , title
           , company
           , address
           , address2
           , city
           , [state]
           , zip
           , country
           , stamptime
  
      FROM
          lead
      where
           ((@DateTo is null AND @DateFrom IS null) or (stamptime BETWEEN @DateTo AND @DateFrom))
  </code></pre>
  
  <p>Thanks!</p>