Solved

SSIS Custom Destination Component - Input Buffer to DataTable

Posted on 2009-07-09
2
1,382 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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

726 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