BCP Utility on Remote Server

已答复 BCP Utility on Remote Server

  • mercredi 8 août 2012 10:51
     
     

    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

    • Type modifié SanthoshH mercredi 8 août 2012 11:07
    •  

Toutes les réponses

  • mercredi 8 août 2012 11:23
     
     Réponse proposée

    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


    • Modifié vr.babu mercredi 8 août 2012 11:29
    • Proposé comme réponse vr.babu mercredi 8 août 2012 11:29
    •  
  • mercredi 8 août 2012 11:41
     
     

    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

  • mercredi 8 août 2012 12:08
     
     Réponse proposée

    Hi,

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


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    • Proposé comme réponse vr.babu mercredi 8 août 2012 13:14
    •  
  • mercredi 8 août 2012 12:16
     
     
    But even Then its not Working

    Please have look on the comment

  • mercredi 8 août 2012 13:16
     
     Traitée

    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

    • Proposé comme réponse vr.babu mercredi 8 août 2012 13:37
    • Marqué comme réponse SanthoshH jeudi 9 août 2012 05:25
    •  
  • mercredi 8 août 2012 13:19
     
     Traitée

    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

    • Proposé comme réponse vr.babu mercredi 8 août 2012 13:37
    • Marqué comme réponse SanthoshH jeudi 9 août 2012 05:26
    •