Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1422
  • Last Modified:

SSIS Custom Destination Component - Input Buffer to DataTable

Hi There,

I am writing SSIS custom destination component that implements precompiled custom data processing logic in the ProcessInput method . I need to implement the exposed API that expects IDataReader object as a parameter.

My question is: what is the easy way to transform Input Pipeline buffer into DataTable or DataReader.

Many thanks in advance.
0
nognew
Asked:
nognew
1 Solution
 
Craig YellickDatabase ArchitectCommented:
At any given moment the buffer is a single instance of data for a set of columns, so it could be loaded into a datatable. You would then have to add rows as buffers are presented.

A DataReader returns data when requested, so its not an obvious fit for a destination.  Here's the caller's context when constructing a datareader instance:

   dim r as datareader
   r = cmd.ExecuteReader
   while r.read
     ...

The caller decides when to call the Read method, whereas your destination component will be receiving buffers from the pipeline with no obvious coordination between receiving a row and the caller requesting a row.

-- Craig
0
 
nognewAuthor Commented:
Thanks Craig,

I ended up with temp cache object that collects buffers data and loads it to Datatable. Then called the interface method and passed  the object:
write.Write(new DataTableReader(inputBufferCache.dataTable))

Cheers
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now