Reputation: 322
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
Upvotes: 0
Views: 1169
Reputation: 1090
When running commands in xp_cmdshell
paths are relative to the server
Upvotes: 1