title: Procedure don´t run correctly
body: <p>I create simple procedure who insert data from one table to another table. When I press execute It only mark as successfull but it don´t do any. But If I get a piece of code and press executed, it runs correctly: there are an images of what occur:<a href="https://i.stack.imgur.com/CCULh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CCULh.png" alt="enter image description here"></a>
  and If I select piece of code:</p>
  
  <p><a href="https://i.stack.imgur.com/GqA8o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GqA8o.png" alt="it runs correctly so something with m"></a> I think  try catch is wrong. Can anyone help me? Regards</p>
  
  <p><strong>Store:</strong></p>
  
  <pre><code> BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      SET NOCOUNT ON;
  
      BEGIN TRY
      BEGIN TRANSACTION;
      --Delete all registers of Proceso.srcUnidadesPresupuestadas 
      DELETE FROM Proceso.srcUnidadesPresupuestadas 
  
      --Insert in table Proceso.srcUnidadesPresupuestadas 
      INSERT INTO Proceso.srcUnidadesPresupuestadas (
      IdCliente,IdCentro,IdNumeroParte,keyNumeroParte,keyCliente,
      keyCentro,Periodo,Mes,UnidadesPresupuestadas,
      mdOrigenCarga,mdUsuarioCarga,mdFechaCarga,bActivo) 
      SELECT
          keyCliente,keyCentro,keyMaterial,keyCliente,keyCliente,
          keyCentro,Periodo,Mes,UnidadesPresupuestadas,
          mdOrigenCarga,mdUsuarioCarga,mdFechaCarga,bActivo FROM Proceso.tmpUnidadesPresupuestadas
      --FROM
      --    #tmpUnidadesPresupuestadas
  
  
   COMMIT TRANSACTION;
      END TRY
      BEGIN CATCH
          IF @@TRANCOUNT &gt; 0
              ROLLBACK TRANSACTION;
  
          DECLARE
              @ERROR_SEVERITY INT,
              @ERROR_STATE    INT,
              @ERROR_NUMBER   INT,
              @ERROR_LINE     INT,
              @ERROR_MESSAGE  NVARCHAR(4000);
  
          SELECT
              @ERROR_SEVERITY = ERROR_SEVERITY(),
              @ERROR_STATE    = ERROR_STATE(),
              @ERROR_NUMBER   = ERROR_NUMBER(),
              @ERROR_LINE     = ERROR_LINE(),
              @ERROR_MESSAGE  = ERROR_MESSAGE();
  
          RAISERROR('Msg %d, Line %d, :%s',
              @ERROR_SEVERITY,
              @ERROR_STATE,
              @ERROR_NUMBER,
              @ERROR_LINE,
              @ERROR_MESSAGE);
      END CATCH
  END
  </code></pre>