Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Unable to retrieve column information from the data source Error msg SSIS Expand / Collapse
Author
Message
Posted Saturday, December 8, 2012 5:37 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:44 PM
Points: 5,317, Visits: 12,352
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1394324
Posted Tuesday, February 19, 2013 10:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 2:20 PM
Points: 7, Visits: 148
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.
Post #1421774
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse