title: Do I need to drop or deallocate a temporary table in SQL Server?
body: <p>I've written a few scripts that declare a TABLE and a CURSOR.  At the end of the script, I deallocate the CURSOR.  Am I also supposed to deallocate the TABLE?</p>
  
  <pre><code>DECLARE @MyTable TABLE (columns);
  INSERT @MyTable(columns) VALUES (values)
  INSERT @MyTable(columns) VALUES (values)
  ...
  
  DECLARE workorders SCROLL CURSOR FOR
  SELECT (rest of statement);
  
  ... work...
  
  CLOSE workorders;
  DEALLOCATE workorders;
  </code></pre>