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!

Copy a text file in DTS

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I have a dts command that creates a comma delimited flat file. It puts it out with a CSV extention so Excel can read it.

I need to append headers to the TOP of this file. Is there any way to do this? I tried:

Using and axtivex script to do a dos copy command - no work.

The command is Copy Header.csv+DBFile.csv NewFile.csv

I can not use an execute process command because sql server can not find the copy command because it's part of the operating system and not an exe.

Any ideas?

Can I open the file with an AX script and write to the top of the file?
 
You can use SQL Server to do the append operation. The command would be ...

exec master..xp_cmdshell 'COPY FileA.csv+FileB.csv NewFile.csv'

You may need to add the path to the copy statment if you recieve an error that the files do not exist.

Thanks

J. Kusch
 
Ahhhhhhhhhhhh. I see. I was yrying to do it from an ActiveX module. Me Bad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top