Отвечено 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
    NULL

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

    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


    • Edited by vr.babu Wednesday, August 08, 2012 11:29 AM
    • Proposed As Answer by vr.babu Wednesday, August 08, 2012 11:29 AM
    •  
  • 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

    Hi,

    It should be \\Remote\C$\... not \\Remote\C:


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    • Proposed As Answer by vr.babu Wednesday, August 08, 2012 1:14 PM
    •  
  • Wednesday, August 08, 2012 12:16 PM
     
     
    But even Then its not Working

    Please have look on the comment

  • Wednesday, August 08, 2012 1:16 PM
     
     Answered

    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

    • Proposed As Answer by vr.babu Wednesday, August 08, 2012 1:37 PM
    • Marked As Answer by SanthoshH Thursday, August 09, 2012 5:25 AM
    •  
  • Wednesday, August 08, 2012 1:19 PM
     
     Answered

    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

    • Proposed As Answer by vr.babu Wednesday, August 08, 2012 1:37 PM
    • Marked As Answer by SanthoshH Thursday, August 09, 2012 5:26 AM
    •