Join 3 tables INTO 1 new table
<p>Table A = Clarity (uniqe ID = CaseID; contains CSN)</p>

<p>Table B = Survey (unique ID = CSN)</p>

<p>Table C = QA (unique ID = caseID; contains CSN)</p>

<p>Table D = FullData</p>

<p><strong>Goal:</strong></p>

<p>“TableD” contains:</p>

<p>all “TableC”,</p>

<p>all “TableA” for which there is a “CaseID” and “CSN” in common with “Table C”</p>

<p>all “TableB” for which there is a “CSN” in common with “Table C”</p>

<p>Table is remade every evening.  There are a lot of people who will be doing query research on “Table D.”  I think it needs to be a table and not a view.</p>

<p><strong>I was going to use:</strong></p>

<pre><code>Create TableD AS    
    Select *    
    From TableC    
    Left Join TableA    
      ON  TableA.CaseID = TableC.CaseID AND TableA.CSN = TableC.CSN    
    Left Join TableB    
      ON TableC.CSN = TableC.CSN
</code></pre>

<p>I was going to use SQL Agent to make the script run every night.  This seems too simple.  Do I have to drop the table that was made the day before? Does anyone see an error?  I am using Microsoft SQL Server.</p>