Solved

SSIS Custom Destination Component - Input Buffer to DataTable

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now