title: How to check if a command has executed successfully inside a procedure
body: <p>Let's say I have this procedure</p>
  
  <pre><code>ALTER PROCEDURE CallsChange
      @ID int,
      @CS int
  AS
  BEGIN
      SET NOCOUNT ON;
  
      INSERT INTO [ctlCalls] ([InsertDate])
      VALUES (GETDATE())
  
      UPDATE [ctlOrders]
      SET [DeliverymanID] = NULL,
          [CallId] = (SELECT SCOPE_IDENTITY()),
          [CurrentStatus] = 1
      WHERE ID = @ID 
  END
  </code></pre>
  
  <p>What I want to know is: if there is a SQL Server variable that returns value if after update something has changed in database or not? In other words: if update has been run successfully</p>