October 31, 2006 at 4:21 pm
I used this command to export data out to text file with comma delimiter; however, it did not show the table field name for me. Is there a way to go over it. Data looks good but I need field name as well.
bcp pubs..publishers out publ_out /c /t , /r \n /Sservername
/Usa /Ppassword
Thanks in advance.
Minh Vu
October 31, 2006 at 8:43 pm
They don't have a switch for it so....
bcp "SELECT 'Pub_ID','Pub_Name','City','State','Country' UNION ALL SELECT * FROM Pubs..Publishers" queryout publ_out /c /t , /r \n /Sservername /Uloginname /Ppassword
You could do a trick or two with OSQL but it will have dashed lines in it so not a good idea...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 31, 2006 at 9:46 pm
And this "Header" row will eventually end up at the end of the file or somwhere betwen the lines.
_____________
Code for TallyGenerator
October 31, 2006 at 10:08 pm
Hasn't yet, Serqiy...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply