0

I'm using xp_cmdshell bcp to generate CSV file from the output, But I'm not able to generate the file, it gives me following output when executed.

I get this as the output, I'm not sure what is going on as I do not have much of hands on using xp_cmdshell I see there is something to do with -l login timeout, but not sure what is the time out

enter image description here

Below is the query I'm running

BCP "Select * FROM #temp" queryout "F:\Share\Test\test.csv" -c -t "|" -T -S<ServerName>

I'm expecting csv file with the result containing pipe separated values

Nuthan Gowda
  • 255
  • 3
  • 6
  • 19
  • You'll need to include your SQL code that is building the bcp statement you are passing to xp_cmdshell. The output you are seeing is what BCP gives you when bad command is issued. – jamie Jul 18 '19 at 22:09
  • The command you have listed here seems fine, so the question is if what you shared here is actually what is being sent to BCP via xp_cmdshell. Include your SQL code that is build the BCP command and that is calling xp_cmdshell – jamie Jul 18 '19 at 22:10

0 Answers0