bcp

  • can anyone help with bcp code exporting specfic fields from SQL server to txt/excel format

  • With bcp you can export to a text file not to excel. You must execute BCP -q"Select of columns that you want" textfile_path -Usa -Ppass -dDatabase. Check also running bcp -? for options about the format that you can specified to create the text file.

    Once you have the text file, export it to excel.

  • Of course, if you have been careful in the creation of the text file, ExCel can read it directly.

    Is DTS an option here?

    Guarddata-

  • I would use

    bcp "select icol1,col2 from databasename..tablename" queryout filename.csv -c -t "," /S servername /U username /P password

    But as Guarddata stated, maybe DTS would be better.

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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