BCP Utility on Remote Server
-
Wednesday, August 08, 2012 10:51 AM
Hi ,
My Query goes as shown below
Exec xp_cmdshell ' bcp "Select * from Test..T2" QueryOut "\\<ServerName\C:\Users\santhoshh\Desktop\Novels\Results.txt" -T -c -t"|" -S Santhoshh\SqlExpress'
Above Wrks with the local machine but getting an error as shown below whenever trying to access remote server
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Unable to open BCP host data-file
NULLPlease help me out in debugging this query .
thanks,
Santhosh
Please have look on the comment
- Changed Type SanthoshH Wednesday, August 08, 2012 11:07 AM
All Replies
-
Wednesday, August 08, 2012 11:23 AM
hi Santosh
please check xp_readerrorlog is enable or not,
check the screen shot which i have done on my desktop
Ramesh Babu Vavilla MCTS,MSBI
-
Wednesday, August 08, 2012 11:41 AM
Hi Ramesh,
Its wrking on my local maschine if replace my address to remote server i.e say from C:\Test to \\Remoteserver\C:\ then again i get the same bcp error
Please have look on the comment
-
Wednesday, August 08, 2012 12:08 PM
- Proposed As Answer by vr.babu Wednesday, August 08, 2012 1:14 PM
-
Wednesday, August 08, 2012 12:16 PMBut even Then its not Working
Please have look on the comment
-
Wednesday, August 08, 2012 1:16 PM
Hi,
Please, try the following query
Exec xp_cmdshell 'dir \\<ServerName\C$\Users\santhoshh\Desktop\Novels\Results.txt'
Does it work?
If it doesn't, then SQL Server account doesn't have the necessary privileges to access that remote folder, that would be the case when SQL Server runs with
local credentials instead of domain ones.
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu
-
Wednesday, August 08, 2012 1:19 PM
Check for SQL Server Services is started with a Domain Account
please make sure that the destination server folder is shared with FULL Access properties
Ramesh Babu Vavilla MCTS,MSBI

