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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know how to write to a text file using transact sql

Status
Not open for further replies.

Rahel

Programmer
Feb 16, 2000
30
GB

I need to add a header and footer to a text file. I have the header and footer done using transact but, I don't how to attach the header and footer to the text file (csv).
Is it possible using transact?

what i want to be able to do is open the text file using transact sql and to paste the header on the first line of the text file, and also paste the footer on the last line of the text file.
 
If no other way, I know you can use activex controls within SQL so you could create an instance of the file system scripting object and open your file (you'll need two cause you can't write into the existing file but will have to merge your new data and old data together into a new file).
If you can avoid it, it'd be easier to simply return your header/footer to a program(VB?) and do it there?? Using Activex in SQL can be dicey and you can mess up the whole server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top