title: UPDATE row when matching row exists in another table
body: <p>I need to update a field on a table to be true only if a matching row exists in another table, for all the rows where the column is currently null in the main table.</p>
  
  <p>This is a description of what I want to achieve:</p>
  
  <pre><code>UPDATE [LenqReloaded].[dbo].[Enquiry] A 
  SET [ResponseLetterSent] = 1
  WHERE [ResponseLetterSent] IS NULL
     AND EXISTS
         (
             SELECT * FROM [LenqReloaded].[dbo].[Attachment] B 
             WHERE A.[EnquiryID] = B.[EnquiryID]
         )
  </code></pre>
  
  <p>This isn't syntactically correct.</p>
  
  <p>I can't code it via an IF EXISTS... statement because I don't have the [EnquiryID] without reading the data from the table.</p>
  
  <p>How should I format my UPDATE statement?</p>