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

write into flat files from inside sql server

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi,

I need to continueiously create a flat file from each
update of record in the table through trigger.
Without using xp_cmdshell is there a way to create a file
and write into it

thanks in advance
 
No way exists to directly write to a text file from a stored procedure or trigger. There are several ways to indirectly output text from a SP. Check the info in the SQL FAQ at
Writing a text file from a trigger is going to very time consuming. It will slow down the record update/insert process significantly. Perhaps you want to reconsider the process.

Another option would be to record transactions in a table in the trigger. Run a job that executes a stored procedure to read the table and write the flat file(s). This could be handled on a schedule and would lessen the impact on individual record updates. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top