Cannot bulk load because the file could not be opened. Operating system error code (null).

Alex Blanes 21 Reputation points
2021-09-22T12:46:47.097+00:00

Hello everbody,

I have a Azure SQL Database a side of that that I'm working on a Windows 10 with vSQL Server Management Studio 15.0.18386.0

The last week I imported some data successfully with bulk method.

Today the execution of the same query launched this error ;

"Cannot bulk load because the file could not be opened C:****. Operating system error code (null)."

After this I searched about and found that people was having trouble because the file was on read only.

In my case I didn't set any file to read only anyways I tried some things:

-Set total control permission for the user that MMSS uses behind.

-Run as admin the CMD and connect trought sqlcmd to the server and launch the same querry.

-Moved the files to another device and change the path of the query

I don't know where the error can be. In this gap of time, I only installed a secure software. Beside that nothing more.

Maybe this is not the right forum to ask this, tell me if that's the case. But I found someone with the same asking a simila error.

Thanks in advance

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,351 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Alex Blanes 21 Reputation points
    2021-09-22T17:07:20.567+00:00

    I think I found one thing that will explain at least why It is not working.

    On this doc about the bulk command.

    https://learn.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql?view=sql-server-ver15

    This is shown:

    134380-imagen.png

    Anyway this does not resolve why the week before It worked.

    I did not have at anytime a blob where to upload the files from.

    I insist again, the paths were local and I saved them exactly as they worked because I knew I would reuse it again.


  2. Seeya Xi-MSFT 16,461 Reputation points
    2021-09-23T09:37:46.833+00:00

    Hi @Alex Blanes ,

    Yes. You find the correct doc.
    Azure SQL Database only supports reading from Azure Blob Storage. File Storage is not supported.
    So i recommend you to use Blob Storage.

    Best regards,
    Seeya


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments