SSMS unable to execute openrowset query

Guruprasad Kulkarni 60 Reputation points
2023-12-28T16:23:31.89+00:00

Hi Team,

I am unable to execute below query in SSMS due to error. However, I can execute same query in synapse studio without any issue. Please advice.

Screenshot 2023-12-24 130851

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.
5,377 questions
{count} votes

Accepted answer
  1. Bhargava-MSFT 31,261 Reputation points Microsoft Employee Moderator
    2023-12-29T17:46:09.3333333+00:00

    Hello Guruprasad Kulkarni,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept" the answer.

    Issue: Unable to execute openrowset query from SSMS, the same query executes fine from synapse studio

    Unable to execute below query in SSMS. However, the same query in synapse studio executes fine without any issue.

    SELECT

    Top l00 *

    • from openrowset (bulk '/raw/parquet/log.parquet',

    data_source ='xxx',

    format = 'parquet') as result

    Error Message:

    file '/raw/parquet/log.parquet' cannot be opened because it doesnot exist or it is used by another process

    Solution:

    The identity used here is different when compared to synapse studio(Microsoft entra identity) and SSMS(SQL login). The Entra ID has 'storage blob data contributor' role.

    This was resolved by using the same email-id(Entra ID) while logging into SSMS.

    Authentication: Azure active directory- Universal with MFA

    User name: Microsoft Entra Identity

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.
    Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Guruprasad Kulkarni 60 Reputation points
    2023-12-29T15:15:23.0933333+00:00

    Actually, issue is, I have logged in synapse with email which has 'storage blob data contributor' role. However, in SSMS I have logged in using SQL authentication. Hence, I could access tables in database but not the file in ADLS. Hence, I have set that email as admin in Microsoft Entra and use the same email-id while logging into SSMS. I choose the option 'Microsoft Entra MFA' in SSMS which solves the problem.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.