BCP using UNC path

  • HI - We are using BCP utility to write the query to a text file. When we write to local file it is writing without any issues. However, issue is coming when we write the data to UNC path. Can some one tell me how to access the UNC path to write the data to text file using bcp utility.

    select * into ##menu_item_test from menu_item

    DECLARE @StmtVARCHAR(8000)

    SET @Stmt = N' BCP "select * from ##menu_item_test " QUERYOUT \\192.11.1.1\Drops -c -T'

    EXEC XP_CMDShell @Stmt

    I am getting the below error:

    SQLState = HY000, NativeError = 0

    Error = [Microsoft][SQL Native Client]Unable to open BCP host data-file

    NULL

    thanks


    erajendar

  • I believe when you run this that the SQL Server service account might need rights to the destination.

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

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