• "You cannot use a stored procedure to insert data into a Table Variable or Derived Table. For example, the following will work: INSERT INTO #MyTempTable EXEC dbo.GetPolicies_sp whereas the following will generate an error: INSERT INTO @MyTableVariable EXEC dbo.GetPolicies_sp."

    I've tested this on SQL2005 and it works fine. Am i doing something "wrong"?

    From http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1267047,00.html

    “Changes to table variables in SQL 2005

    There are limitations on how you can use table variables. The limitations began changing with SQL Server 2005. Namely, table variables could not be used as the destination of an INSERT EXEC command such as

    insert @variable

    exec sp_who

    Starting in SQL Server 2005, this limitation was removed and table variables can now be used as the destination for INSERT EXEC commands.

    Cheers,

    Andre

    Andre