title: SQL Server 2008 - MERGE statement - Perform multiple actions in WHEN MATCHED block
body: <p>I am trying to use MERGE statement to accomplish the following. I have a SP and i am passing TableValue Parameter to it. This is how my SP looks like:</p>
  
  <pre><code>CREATE PROC sp_AddInformation
  @IntoTbl dbo.Information  READONLY ,
  @baseEventType dbo.EventType READONLY 
  
  AS
  
  BEGIN
  
  MERGE Information
  USING (SELECT InfoID, NewsID, NewsType FROM @IntoTbl ) AS baseInfo (InfoID, NewsID, NewsType)
  ON (info.infoID = baseInfo.InfoID)
  WHEN MATCHED
          THEN 
          --EXEC dbo.sp_insertEventInfo(@baseEventType) (This is not working)
  
          UPDATE set Info.Reporter = baseInfo.Reporter
  WHEN NOT MATCHED BY SOURCE
          THEN 
  
          DELETE
  WHEN NOT MATCHED BY TARGET
      THEN INSERT VALUES (InfoID, NewsID,NewsType);
  END
  </code></pre>
  
  <p>Does anyone know how can i call another SP or perform another MERGE on other tables in WHEN MATCHED block?</p>