title: TSQL Delete Using Inner Joins
body: <p>The following SQL statement executes fine on my database:</p>
  
  <pre><code>SELECT * FROM tblKPIs AS k 
  INNER JOIN tblKeyPointLinks AS l ON k.KPIID = l.KPIID 
  INNER JOIN tblKeyPoints AS p ON p.KptID = l.KptID 
  INNER JOIN tblHistory AS h ON h.HistoryID = p.HistoryID 
  WHERE h.CaseNo = 50043;
  </code></pre>
  
  <p>Yet the equivalent Delete statement gives an error 'syntax near AS'?</p>
  
  <pre><code>DELETE FROM tblKPIs AS k 
  INNER JOIN tblKeyPointLinks AS l ON k.KPIID = l.KPIID 
  INNER JOIN tblKeyPoints AS p ON p.KptID = l.KptID 
  INNER JOIN tblHistory AS h ON h.HistoryID = p.HistoryID 
  WHERE h.CaseNo = 50043;
  </code></pre>
  
  <p>Can I not use Joins in Delete statements?  </p>
  
  <p>If not how do I perform the above Delete?</p>
  
  <p>EDIT</p>
  
  <p>The table tblKeyPointLinks is an intermediate table to establish a many-to-many relationship between tblKPIs and tblKeyPoints.  Therefore the SELECT statement returns some of the entries in tblKPIs more than once.  Is this why the DELETE statement is having problem perhaps?  What is the best way to work around this?</p>