テーブル変数に出力して、そこから取得できます。これを試してください:
DECLARE @t table (C1 int, C2 int)DECLARE @C1 INT, @C2 INTDECLARE @Output TABLE (DeletedC1 INT, DeletedC2 INT, ActionType VARCHAR(20), InsertedC1 INT, InsertedC2 INT)set @c1 =1set @c2 =1MERGE @t as tgtUSING (SELECT @C1, @C2) AS src (C1, C2)ON (tgt.C1 =src.C1) WHEN MATCHED AND tgt.C2 !=src.C2 THEN UPDATE SET tgt .C2 =src.C2 WHEN NOT MATCHED BY TARGET THEN INSERT VALUES (src.C1, src.C2) OUTPUT deleted.*, $action, inserted.* INTO @Output;SELECT * FROM @Output WHERE ActionType ='INSERT'コード> プレ>