Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export text with trailer record 1

Status
Not open for further replies.

cdbzb

Programmer
Mar 26, 2004
1
US
Is there a way to export a text file with a trailer record (containing summary information)? I tried adding a COMPUTE statement to the stored procedure, but DTS ignores it.

Thanks!
 
The way I have had to handle a similiar issue, had to add a header record, was to create the header record as a text file called HeaderRec.txt. Then I create a file called Detail.txt that contained the detail records. As the final step, a created a "Execute SQL Task" that ran the floowing command ...

EXEC master..xp_cmdshell
'COPY /b C:\MyDir\HeaderRec.txt + C:\MyDir\Detail.txt C:\MyDir\FullFile.txt'

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top