January 29, 2003 at 2:36 pm
can anyone help with bcp code exporting specfic fields from SQL server to txt/excel format
January 29, 2003 at 3:30 pm
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.
February 7, 2003 at 8:53 am
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-
February 10, 2003 at 4:00 am
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