DP203- Explore Synapse Lab 01 -Use a serverless SQL pool to analyze data

Samantha Sow 0 Reputation points
2024-06-13T14:59:43.6+00:00

I encountered problem in running the SQL

-- This is auto-generated code SELECT     TOP 100 * FROM     OPENROWSET(         BULK 'https://datalakexxxxxxx.dfs.core.windows.net/files/product_data/products.csv',         FORMAT = 'CSV',         PARSER_VERSION='2.0' ) AS [result]

Error is that this file is in use

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,679 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 85,511 Reputation points Microsoft Employee
    2024-06-14T07:25:19.7966667+00:00

    @Samantha Sow - Thanks for the question and using MS Q&A platform.

    The error message you are seeing indicates that the file you are trying to access is currently in use. This could be because another process or user has the file open, or because the file is locked for editing.

    To resolve this issue, you can try closing any other applications or processes that may be using the file, or wait for the file to become available again. You can also try accessing a different file to see if the issue persists.

    New SQL script -> Select TOP 100 rows works with the files with below format (csv, json, parquet).

    79575-synapse-selecttop100rows.gif

    If your query fails with the error File cannot be opened because it does not exist or it is used by another process and you're sure that both files exist and aren't used by another process, serverless SQL pool can't access the file. This problem usually happens because your Microsoft Entra identity doesn't have rights to access the file or because a firewall is blocking access to the file.

    By default, serverless SQL pool tries to access the file by using your Microsoft Entra identity. To resolve this issue, you must have proper rights to access the file. The easiest way is to grant yourself a Storage Blob Data Contributor role on the storage account you're trying to query.

    For more information, see:

    For more details, refer to Query fails because file can't be opened.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments