When a record is inserted, I need to export the data to a text file and email it. I tried using xp_sendmail with @attach_results set to true, but, the text file is not in a data format. Then, I used DTS to export the data which turned out well, but I cannot figure out how to do this on the fly. Is there some code I can put in an insert trigger to do this? Thanks.