Using BCP Utility from command prompt

  • Hi all,

    May I ask if we're using BCP utility from command prompt, and it is executed from Comp. A, while the program and SQL Server is on Comp. B, what security I need to set first ?

    I execute the BCP using batch file which also reside on Comp. B. Now there is an error saying "Access is denied", For now I can only think that the I should give security access to the folder in Comp B. Given "Everyone -> full control" but still has that same error.

    Kindly help.

    Thanks,
    Anton

  • Does the batch file on computer B work using the same credentials you are logging on to Computer A with?

    ***The first step is always the hardest *******

  • tonzonline - Friday, October 12, 2018 2:57 AM

    Hi all,

    May I ask if we're using BCP utility from command prompt, and it is executed from Comp. A, while the program and SQL Server is on Comp. B, what security I need to set first ?

    I execute the BCP using batch file which also reside on Comp. B. Now there is an error saying "Access is denied", For now I can only think that the I should give security access to the folder in Comp B. Given "Everyone -> full control" but still has that same error.

    Kindly help.

    Thanks,
    Anton

    No.  You have it backwards.  

    If the batch file and the databases are on Comp B, the SQL service account for Comp B will need access to the folder where the files are being written to on Comp A

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Michael L John - Friday, October 12, 2018 9:33 AM

    tonzonline - Friday, October 12, 2018 2:57 AM

    Hi all,

    May I ask if we're using BCP utility from command prompt, and it is executed from Comp. A, while the program and SQL Server is on Comp. B, what security I need to set first ?

    I execute the BCP using batch file which also reside on Comp. B. Now there is an error saying "Access is denied", For now I can only think that the I should give security access to the folder in Comp B. Given "Everyone -> full control" but still has that same error.

    Kindly help.

    Thanks,
    Anton

    No.  You have it backwards.  

    If the batch file and the databases are on Comp B, the SQL service account for Comp B will need access to the folder where the files are being written to on Comp A

    And, if you can avoid it, do not grant "everyone" permissions.  Invariably, whenever permissions like this are granted, one never remembers to remove them.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

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

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