MERGE-Insert-후-ID-값-리턴-받아보기1 [MSSQL] MERGE Insert 후 IDENTITY ID 값 리턴 받아보기 -_-;; 예제 구체적이지 않아 죄송합니다;;INSERT @OutPutTbl SELECT * FROM ( MERGE TargetTbl AS TargetTbl USING (SELECT * FROM @InstUpdtTarget) AS InstUpdtTarget ON TargetTbl.IvtID = InstUpdtTarget.IvtID AND TargetTbl.PlaceCD = InstUpdtTarget.PlaceCD WHEN MATCHED THEN UPDATE SET TargetTbl.ID = InstUpdtTarget.ID WHEN NOT MATCHED THEN INSERT VALUES (InstUpdtTarget.ID) OUTPUT Inserted.ID,InstUpdtTarget.ID,$action ) AS Res.. 2015. 12. 10. 이전 1 다음