all groups > sql server dts > january 2005 >
You're in the

sql server dts

group:

Add a header to a Text File ("Destination")



Add a header to a Text File ("Destination") LP
1/31/2005 10:27:06 AM
sql server dts: Hello All,

I'm exporting a SQL table to a text file and want to add a little bit of
header information. Is the best option ActiveX Script using FSO?

Any thoughts.

Thanks,

Re: Add a header to a Text File ("Destination") Darren Green
2/2/2005 12:22:03 AM
In message <3D23800D-32B4-4986-AAB9-61993A24E077@microsoft.com>, LP
<LP@discussions.microsoft.com> writes
[quoted text, click to view]

My preferred method is to use DOS. Create two files, one for the header
and one for the data. Use the FSO to create the header file by all
means.

Then use DOS to combine-

copy header.txt+data.txt output.txt

Using FSO to combine means reading all the data to write it out again
and the FSO is great, but not very fast, so if it is a large file, avoid
it. If it is a small file and you are comfortable with FSO then it will
probably be quicker to stuck with what you know.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
AddThis Social Bookmark Button