Forum Discussion

EaglesTony's avatar
EaglesTony
Post Prodigy
1 year ago
Solved

Cannot execute a stored procedure

Hi,

 

  I have a stored procedure RPT.MarketValue.

 

  When I go to Get the SQLServer data, I enter the server, the database and Import and put "EXEC  RPT.MarketValue" , but it gives me the error "The EXECUTE persmission was denied", however when I copy and paste the SQL instead it works ???

 

Is it because it is a stored procedure instead of a view maybe ?

  • KNP's avatar
    KNP
    1 year ago

    If the stored proc provides the data you need, I would get permissions added to the account that is going to be refreshing the data. If that's going to be a service principal, you may need execute access added to your account, at least temporarily, while you are developing.

     

4 Replies

  • KNP's avatar
    KNP
    Super User

    It sounds like your account doesn't have EXECUTE permission on the database.

     

    Have you tried executing the stored procedure in SSMS/Azure Data Studio?

    I suspect you'll get the same error.

    You'll need to get your DBA to alter your permissions.

     

    • EaglesTony's avatar
      EaglesTony
      Post Prodigy

      I think your are correct, as I am trying to convert an SSRS report to PowerBI and think the SSRS was running under a service account, where I am running under my windows login assigned to a AD-Group which has certain permissions.

       

      I can run views though or copy/paste the sql from the stored procedure and that works.

      • KNP's avatar
        KNP
        Super User

        If the stored proc provides the data you need, I would get permissions added to the account that is going to be refreshing the data. If that's going to be a service principal, you may need execute access added to your account, at least temporarily, while you are developing.

         

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi EaglesTony ,
    Thanks for reaching out to the Microsoft fabric community forum.

    Thank you to KNP  for some valuable points, 
    Please check this article on how to grant a user acces to stored procedure: Grant Permissions on a Stored Procedure - SQL Server | Microsoft Learn
    it will help give you access to the stored procedure and will resolve the error.

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
    Thank you