Metadata Discovery in SSIS 2012 not working with temp tables
SQL Server Integration Services is a tidy bit of kit and an absolute must have on any SQL Server developer or administrator’s toolbelt. However, it is as frustrating as it is sublime, with many obfuscated error messages, quirky behaviours and downright oddness. I ran into one such quirk recently while setting up a Data Flow Task using an OLE DB Source that loaded its data from a Stored Procedure, specified by a package Variable. Everything was working fine until I identified that I needed to do something in the stored procedure that resulted in my using a temporary table. As soon as I updated the procedure and attempted to refresh the columns in my OLE DB Source, I was hit with the following error:
Msg 11525, Level 16, State 1, Procedure My_Stored_Procedure_Name, Line 1
The metadata could not be determined because statement 'My SQL Statement Here;' uses a temp table.
So why does this happen, even when I’ve defined the type of the column in my procedure?read more