Friday, February 24, 2012

Error: unable to retrieve column information from the data source

Hi,

I am trying to set up a data flow task. The source is "SQL Command" which is
a stored procedure. The proc has a few temp tables that it outputs the final
resultset from. When I hit preview in the ole db source editor, I see the
right output. When I select the "Columns" tab on the right, the "Available
External Column List" is empty. Why don't the column names appear? What is
the work around to get the column mappings to work b/w source and
destination in this scenario.

In DTS previously, you could "fool" the package by first compiling the
stored procedure with hardcoded column names and dummy values, creating and
saving the package and finally changing the procedure back to the actual
output. As long as the columns remained the same, all would work.
Thats not working for me in SSIS.

Thanks in advance.
Asim.

Anyone?

|||I am having the same problem. I assume it is because the stored procedure I am using is long running (1min 20s) The designer looks like it starts to run the sproc to get the metadata, but then gives up after 15 or 30 seconds. Any solutions?|||

Hi,

If your final select statement is for a temporary table, u will get this problem. Use table variable or actual table instead of temp table.

|||

Yes, I figured out a solution. Basically create a hard coded resultset (select stmt) at the top of the procedure with the same columns as the actual resultset.

That did it for me.

Asim.

|||

Ok, that solution does not work. By adding the header, the package compiles and runs, but the row from the header is inserted in the destination, not from the (actual) second resultset. So I am back to square one.

Can anyone please help.

Asim.

|||This solved my problem. However, it was not enough to change the last select from a temp table to table variable. I had to change all occurences of temp tables to table variables. I also found that it sped up my query by a factor of 16x from 1min 20s to 5s.|||My workaround is to create output columns that are being returned by the query manually.

No comments:

Post a Comment