title: multiple declare statements with one creating a temporary table
body: <p>I am trying to include a declare statement referencing a temporary table with other declare statements. It works on its own, but when I add the remaining declare clauses, I get an error...</p>
  
  <pre><code>    declare  @meas_enddate datetime,
  @meas_startdate datetime, 
  @enc_startdate       
  datetime, 
  @enc_enddate datetime, 
  @activestart datetime, 
  @activeend datetime, 
  @baseline_start datetime,
  @baseline_end datetime, 
  @Dept as Table (DEPARTMENT_ID numeric(18,0) NOT NULL PRIMARY KEY,
  UNIQUE NONCLUSTERED (DEPARTMENT_ID))
  INSERT INTO @Dept
  SELECT 
  '100501201'
  UNION SELECT '100208501'
  UNION SELECT '100302304'...
  </code></pre>