Temp table or table variable in query (not stored procedure), possible?


  • I don't know if it's a local issue but I can't use temp table or table variable in a PP query (so not in a stored procedure)

    Environment: W7 enterprise desktop 32 + Office 2012 32 + PowerPivot 2012 32

    Simple example:

        declare @tTable(col1 int)

        insert into @tTable(col1) values (1)

        select * from @tTable

    Works perfectly in SQL Server Management Studio and the database connection is OK to as I may generate PP table using complex (or simple) queries without difficulty.

    But when trying to get this same result in a PP table I get an error, idem when replacing table variable by a temporary table.


    OLE DB or ODBC error. .... The current operation was cancelled because another operation the the transaction failed.

    Could you please help?

    Many thanks



    Thursday, July 19, 2012 8:55 PM


All replies