Cannot bulk load file error code 12. Azure synapse link, dynamics. Azure synapse workspace. SQL database

Luuk de Vlugt 51 Reputation points
2022-08-31T12:57:59.117+00:00

We created an azure synapse link and a "sql" database in the azure synapse workspace. But sometimes (not all the time) we get an error when selecting with sql from the csv files in the storage account.

The query bulk loads the data from the csv files:
236529-image.png

But gives the following error:
Cannot bulk load because the file ****.csv could not be opened. Operating system error code 12(The access code is invalid.).

I think this is because the azure synapse link that loads the data from our dynamics platform to the storage account, updates the files within the storage accounts at the same time when I am running the query. (the entity accounts for instance is updated almost all the time in our system, for small entities with a few records that never change, this error does not occur)

I am wondering what the solution is, because the prebuild views of the azure synapse link are exactly like this.

I don't want to use the "allow inconsistent data reads" because I think it will mess up the synchronisation of the azure synapse link. Because it updates data, not only appends data.

When I run the query myself it is not a big problem because I will just run it again and it works. But when the query is triggerd by a timer and gives this error the whole proces stops.
Anyone some clever ideas?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,369 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PEYRAS Denis 6 Reputation points
    2023-02-24T10:29:37.0766667+00:00

    Hi,

    Same issue. Any solution?

    I try to add the option
    TABLE_OPTIONS = N'{"READ_OPTIONS":["ALLOW_INCONSISTENT_READS"]}'
    but get this error:
    Operation CREATE EXTERNAL TABLE is not allowed for a replicated database.

    We can not use Dedicated SQL Pool (too expensive) and Azure Synapse Link create automaticly all external table.
    Does the working solution really consist to add the the code "TABLE_OPTIONS = " ?

    Regards,
    Denis

    1 person found this answer helpful.