Solved

SSIS Custom Destination Component - Input Buffer to DataTable

Posted on 2009-07-09
2
1,376 Views
Last Modified: 2013-11-10
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
Comment
Question by:nognew
2 Comments
 
LVL 11

Accepted Solution

by:
CraigYellick earned 250 total points
ID: 24826047
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
 
LVL 8

Author Comment

by:nognew
ID: 24840210
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS SQL: Create User Function to Remove Long Words 5 31
Row insertion failed. Array 5 45
Getting invalid Syntax SQL. 3 14
MS SQL + group by time 4 12
I have a large data set and a SSIS package. How can I load this file in multi threading?
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question