title: Get date of last successful job run?
body: <p>I have a single step job that executes a stored procedure. I would like get the date of the last successful job execution time so that I can just update a delta instead of the whole set of data. </p>
  
  <p>Right now I have the job setup to run once every day, so I have a default parameter that if it's null I set it to GETDATE() - 1 so I'm still updating a delta but what I'd like to do is set the date to the last successful execution of the job.</p>
  
  <pre><code>exec dbo.usp_UpdateFrom @LastSuccessfulExecutionTime
  </code></pre>
  
  <p>Current procedure is something like</p>
  
  <pre><code>CREATE PROCEDURE dbo.usp_UpdateFrom
      @FromDate datetime = NULL --would like to pass last successful execution time of the job
  AS
      IF @FromDate IS NULL
          SET @FromDate = GETDATE() - 1
  
      -- do stuff
  END
  </code></pre>