title: SQL - Subquery returned more than 1 value. - Multiple Databases
body: <p>I am having issues with the following update statement:</p>
  
  <pre><code>UPDATE tblPerson
  SET personStatus = 'Candidate'
  WHERE PersonID = 
  (
      SELECT DISTINCT
          p.PersonnelID
      FROM 
          [Beyond-Auckland].dbo.Personnel p
      WHERE 
          EXISTS (SELECT ID FROM [Beyond-Auckland].dbo.LinkedDocuments L WHERE id = p.PersonnelId
                                                  AND     SiteName IS NOT NULL
                                                  AND     (Document LIKE ('%CV%') 
                                                  OR      Document LIKE ('%resume%')
                                                  OR      Document LIKE ('%Vitae%')
                                                  OR      Document LIKE ('%Cover Letter%'))))
  </code></pre>
  
  <p>I keep getting the following error:</p>
  
  <blockquote>
    <p>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.</p>
  </blockquote>
  
  <p>Not entirely sure what i am doing wrong here, any help would be much appreciate it</p>