Search code examples
bcpssms-2012

BCP output file not getting generated


i am running below query in the ssms 2012.

exec master.dbo.xp_cmdshell 'bcp uctconfiguration.dbo.requirement out D:\requirement.txt -w -T -S "servername"'

Below is the log

NULL Starting copy... SQLState = S1000, NativeError = 0 Error = [Microsoft][SQL Server Native Client 11.0]Warning: BCP import with a format file will convert empty strings in delimited columns to NULL. 1000 rows successfully bulk-copied to host-file. Total received: 1000 1000 rows successfully bulk-copied to host-file. Total received: 2000 1000 rows successfully bulk-copied to host-file. Total received: 3000 NULL 3148 rows copied. Network packet size (bytes): 4096 Clock Time (ms.) Total : 297 Average : (10599.33 rows per sec.) NULL

Data is getting copied to the file.But when i go to the location specified in BCP command , i am not able to find the output file


Solution

  • When running commands in xp_cmdshell paths are relative to the server