title: Print statements in SQL merge
body: <p>I've been asked to include some debugging PRINT statement in a SQL merge, which I'm new to. I've been told that OUTPUT isn't satisfactory.</p>
  
  <pre><code>MERGE Production.UnitMeasure AS target
      USING (SELECT @UnitMeasureCode, @Name) AS source (UnitMeasureCode, Name)
      ON (target.UnitMeasureCode = source.UnitMeasureCode)
      WHEN MATCHED THEN 
          UPDATE SET Name = source.Name
          PRINT "Updated"
      WHEN NOT MATCHED THEN
          INSERT (UnitMeasureCode, Name)
          VALUES (source.UnitMeasureCode, source.Name)
          PRINT "Inserted"
  </code></pre>
  
  <p>This isn't working, as it appears each conditional block should contain a single SQL command.</p>
  
  <p>Is there a simple way to achieve what I'm after?</p>