bcp - include field titles in output text file

  • I would like to be able to wonderful xp_smtp_sendmail mail utility to mail the output of a query daily into a csv (for opening in excel) file. I was going to use bcp in a T-SQL proc to output the query results to a text file, which works. But how can I include the field titles in the file.

    Any tricks or alternative to bcp? Thanks.

     

     


    smv929

  • hi,

    An alternative to bcp is usually DTS. You can include field titles in the DataPumpTask, just check the check box.

     yoav

  • I think I see the check box you mentioned, however, Ent mgr crashes when I set up the package:

    I set a source of SQL db, a destination of Text file, and create a TransformDataTask. On the destination tab, I click the Execute button. No fields appear in the list, which means it won't let me go further. So I click the Define fields button. Then it crashes with a mmc.exe caused a memory fault.

    I have SQLSrv 2000, sp3. I'll look for info on this problem. If anyone knows the answer, please let me know. Thanks!


    smv929

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply