I have a table with some persistent data in it. Now when I query it, I also have a pretty complex CTE which computes the values required for the result and I need to insert miss
You could declare a dummy variable and set its value in the WHEN MATCHED clause.
DECLARE @dummy int; ... MERGE ... WHEN MATCHED THEN UPDATE SET @dummy = 0 ...
I believe it should be less expensive than the actual table update.