UPDATE with CASE with 2 tables I have 2 tables and I want to update table2 with criteria of table1 and table2. 
The criteria are:

1.table1.amount &gt; 10000

2.table2.flag is null or table2.flag = '0'

So if the 2 conditions are true, then update table2.flag = '1' and table2.flagdate = getdate()

table2.flag is a flag to check everyone who pays more than 10,000. But if already flagged, I don't want to flag again because I can't loose the original table2.flagdate. But I try a lot of things, nothing works the way I want. Any ideas?
UPDATE t2 
  SET flag = 1, flagdate = CURRENT_TIMESTAMP
  FROM dbo.table2 AS t2
  INNER JOIN dbo.table1 AS t1
  ON t2.id = t1.id
  WHERE t1.amount &gt; 10000 
    AND (t2.flag IS NULL OR t2.flag = 0);


You can avoid the OR condition if you change the flag column to NOT NULL with default 0.