Got a complex SELECT query, from which I would like to insert all rows into a table variable, but T-SQL doesn\'t allow it.
Along the same lines, you c
One reason to use SELECT INTO is that it allows you to use IDENTITY:
SELECT IDENTITY(INT,1,1) AS Id, name INTO #MyTable FROM (SELECT name FROM AnotherTable) AS t
This would not work with a table variable, which is too bad...