February 27, 2008 at 6:39 am
DTS SQL 2000
A view is used to create the .dat file.
I need to insert a trailer record as at the end of the file.
Trailer record char(36)
Record Count char(7)
Date
filler space(25)
Example:
TRAILER RECORD DATA 737 MMDDYYYY
Looking for help!!!:unsure:
February 27, 2008 at 12:17 pm
Hi Debra,
The technique that I have seen is to write the trailer data to a separate file and concatenate the files at the DOS level. You could also use the FileSystemObject in an ActiveXScript Task to combine the view file and the trailer file.
Norman Kelm
DTS Package Search
February 27, 2008 at 12:23 pm
Hi Norman,
I do not have the knowledge to write a ActiveXScript Task.
Any help would be greatly appreciated!;)
February 27, 2008 at 1:58 pm
Great examples here: http://www.sqldts.com/292.aspx
Here is code that opens a file for append
strFile = "c:\output.txt" ' e.g. c:\output.txt
' ------ END CONFIGURATION ---------
const ForAppending = 8
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine("Script completed: " & Now)
objFile.Close
Norman Kelm
DTS Package Search
February 28, 2008 at 8:40 am
Thanks, Norman
objFile.WriteLine("How do I reference the trailer row here?")
strFile = "c:\output.txt" ' e.g. c:\output.txt
' ------ END CONFIGURATION ---------
const ForAppending = 8
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine("Script completed: " & Now)
objFile.Close
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply