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
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