Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Header Info via PreSource Phase

Author  Topic 

DBunn
Starting Member

14 Posts

Posted - 2002-08-16 : 11:39:00
I've read that one of the great uses for the PreSource phase of a Multi-Phase Data Pump is the ability to include header information in a text file prior to xfering records, but I've yet to see an example of it. Anyone out there have a code example of this?

I'm attempting to xfer records from a table to a text file, transforming along the way, but I need to include a header line before the info. If this is trivial, I'll just slap my forehead and say, "Oh yeah!". I'm sure I can do some fso work-arounds, but it sure would be good to do this the 'DTS' way.

DBunn
Starting Member

14 Posts

Posted - 2002-08-21 : 14:59:41
Let me ask this question a different way.

Many sources indicate that, by using the pre-source and post-source phases of a multi-phase data pump, you can enter header and footer information to a text file when that text file is the data pump's destination My tests indicate that the header information stored in the file are over-written by the first transformed record. Can I keep the header info from being over-written?

Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-23 : 19:18:54
I couldn't find a lot of info on how to use the Pre Source and Post Source to do this but this might help - it uses an ActiveX Script Task [url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=19110[/url]


HTH
Jasper Smith
Go to Top of Page

DBunn
Starting Member

14 Posts

Posted - 2002-08-30 : 23:49:02
Thanks Jasper,

I used a work around kind of like that but within the data pump. I create the header as a string and then concatenate it with a vbCRLF to the front of the first record (if file size = 0 then its the first record) going over to the text file. The footer is added after the pump in a separate activeX task.

Isn't it funny that you can find plenty of books and references that state that "One wonderful thing that you can use the Pre-Source phase for is applying a header to a file before transferring data" but no one's ever been able to do it.


Go to Top of Page
   

- Advertisement -