Possible Duplicate:
T-SQL: How to join @variable tables (another try)
First: I'm using SQL Server 2008. In a complex algorithm that involves a lot of data, I have been using a technical of creating intermediate table variables:
DECLARE @table AS TABLE (Col1 INT, Col2 VARCHAR(100))
Unfortunately, SQL Server does not support JOIN'ing @variable tables, it is only allowed to join "true" tables, those in the database.
I could do the "manual" join, like
FROM @table1 t1, @table2 t2
WHERE t1.Id = t2.Id
This results in a INNER JOIN, but this is wrong for me. The question is: How do FULL JOIN two @variable tables?