title: How to know TSQL Stored Procedure Update Executed
body: <p>How can I check if my TSQL stored procedure updated within the stored procedure in order to create a proper message?</p>
  
  <p>Example: </p>
  
  <pre><code>ALTER PROCEDURE [dbo].[pUpdate]
              @id uniqueidentifier, 
              @status int,
              @message VARCHAR(100) OUTPUT
  AS
  BEGIN
      SET NOCOUNT ON;
  
      UPDATE [database].[dbo].[user]
      SET status = @status
      WHERE Id = @id
  END
  
  IF (SUCCESSFUL)
  BEGIN
      @message = 'Success!'
  END
  </code></pre>
  
  <p>What are some possible ways to check if successful without using the parameters again?</p>
  
  <p>This is what I currently use:</p>
  
  <pre><code>  SELECT COUNT(*)
      WHERE status = @status AND id = @id
  </code></pre>
  
  <p>Are there any other ways? I want to know for my knowledge and reference. Thanks.    </p>