SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to retrieve column information from the data source Error msg SSIS


Unable to retrieve column information from the data source Error msg SSIS

Author
Message
Phil Parkin
Phil Parkin
SSC-Forever
SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)

Group: General Forum Members
Points: 49017 Visits: 21133
T Childers (12/7/2012)
Just in case anyone else has gotten here for the same reason I did which was you're trying to build an SSIS package based on a stored procedure that is selecting the data from a temporary table (Select column1, column2, column3 from #tablename).

If you can, it worked better if we used a table variable instead:
DECLARE @tablename
(Column1 varchar(10),
column2 varchar(10),
column3 varchar(10)
)

Of course, the problem with that is that the data is put all in memory instead of TempDB, but it did resolve our issue.


Unless your table variable is likely to contain fewer than about 100 rows, I would urge you to reconsider.

Your temp table problem will go away if you publish the meta data at the start of your stored proc (a different technique is needed in 2012 - see later).

Here's how to publish your meta data

   
-- Publish metadata for SSIS
if 1 = 0
begin
select
cast(null as bit) [Col1],
cast(null as int) [Col2],
etc etc
end



where the column names and data types line up with what your stored proc will return. Job done.

As I mentioned, in SSIS 2012 this technique no longer works. In fact, things have got tidier, because now the meta data is defined in the EXEC statement:

exec usp_proc1 with result sets 
(
([Col1] bit,
[Col2] int
);



Now on to my final point. It's a common misconception that table variables are held in memory and do not hit tempdb. You might like to do some further reading on this, as others have done the investigative work far better than I. Try this for starters.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
T Childers
T Childers
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 151
Thanks for the additional information and will probably help someone in the future who's googling this error.

In my case, the table was not wide and in general would have less than 50 records and never more than 1500, so although I should have said the data can start out in memory, I would imagine for me it would have stayed in memory and not spilled over to the TempDB.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search