Unable to open host BCP Data file

  • ekknaveen


    Points: 2317

    When I executed the below command I am geting the error unable to open host bcp data file.

    bcp "select * from ##inteirsrvrs, onepoint..computermaintenance cm where idcomp = cm.idcomputer and cm.inmaintenancenow = 1" queryout "D:aveen\maintmode.txt" -c -SC105PC001\PC001 -T

    but when I this statement from dos it is executed.

    Can any one tell me what should be the problem and how to over come this.

    Thanks in advance


  • mtokhay

    SSC Journeyman

    Points: 83

    has your sqlserver instance service account been granted write or full access to your D:\ folder

  • wasim.ahmad780

    SSC Enthusiast

    Points: 177

    Try this
    i think this seems to be exact file (dat file) not select where to import.
    example as below bcp "dbname.dbo.tablename" in "file location\dat file name" -N -S "server name" -T

    it's done.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply