Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems in BCP

Status
Not open for further replies.

jessy111

Technical User
Nov 17, 2002
22
IN
Hi,

I am trying to generate a csv file using BCP command. Its done using an SP.I am passing filename,servername,username,password dynamically in sp

Eg:
SET @vc_SQL = 'bcp '+ 'JES_USER_DETAILS ' + ' out ' + @in_vcFILENAME + ' -S ' +@in_vcSERVERNAME + ' -U' +@in_vcUSERNAME+' -P'+@in_vcPASSWORD+' -c -t, -o d:\err.txt'
EXEC master..xp_cmdshell @vc_SQL

Sp is working fine. I have two questions
1:Right now i am giving the CSV file path to the database server.Its generating CSV no issues.

Is there any way i can give the csv file path to my local machine where my web server is hosted?

2: I am not getting the column names in the csv file.Whats the option for including the column names also in the csv file

Thanks
Jes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top