Lokesh Vij (1/29/2013)
Using merge (as pointed out by demonfox) you can easily user INSERTED.* and DELETED.* (as mentionded by Dwain) after MERGE in order to capture, columns and values which are being updated/inserted/deleted.
Yes and Inserted.col1 , Inserted.col2 woudl work for new data updated or inserted ;
if you are handling delete also in the Merge statement.
then it gets a little difficult to handle insert , delete and update data .
As Insert and Update can be captured by Inserted.* ; but the deleted require Deleted.* , and in the merge statement there is only one Output clause allowed.
In that case you may have to consider using cases by identifying $action property.
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm: