<p>In SQL Server 2005, we can create temp tables one of two ways:</p>

<pre><code>declare @tmp table (Col1 int, Col2 int);
</code></pre>

<p>or</p>

<pre><code>create table #tmp (Col1 int, Col2 int);
</code></pre>

<p>What are the differences between these two?  I have read conflicting opinions on whether @tmp still uses tempdb, or if everything happens in memory.  </p>

<p>In which scenarios does one out-perform the other? </p>

@wcm - actually to nit pick the Table Variable isn't Ram only - it can be partially stored on disk.
A temp table can have indexes, whereas a table variable can only have a primary index. If speed is an issue Table variables can be faster, but obviously if there are a lot of records, or the need to search the temp table of a clustered index, then a Temp Table would be better.
Good background article