Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Suggested answer

error running sp from SL EXECUTE permission was denied on the object 'spname'

Posted on by 150

Hi,

I created an stored procedure for one screen custom with vs tools for Dynamics SL. The screen has a button, the when the user click in the button the application execute a stored procedure.

I used call sql for execute the stored procedure. If I do login with SYSADMIN the stored works fine, but the another users get the error "EXECUTE permission was denied on the object ". 

The stored procedure has permission to the MSDynamicsSL and for the user [E8F575915A2E4897A517779C0DD7CE] because the sp has the instruction WITH EXECUTE AS 'E8F575915A2E4897A517779C0DD7CE'

Which other permission is missing?

Thanks,

Mary

  • Maria Carrero Profile Picture
    Maria Carrero 150 on at
    RE: error running sp from SL EXECUTE permission was denied on the object 'spname'

    I am using the user E8F575915A2E4897A517779C0DD7CE because I am using SL 2015. The sp call the bulk insert instruction

  • Maria Carrero Profile Picture
    Maria Carrero 150 on at
    RE: error running sp from SL EXECUTE permission was denied on the object 'spname'

    Thank you, The error is fixed

  • Erich Strelow F Profile Picture
    Erich Strelow F 1,642 on at
    RE: error running sp from SL EXECUTE permission was denied on the object 'spname'

    What does the sp do?

    If it needs to "jump" between databases, as in calling a msdb.* sp or doing a select on the SL SYS database, you should use the WITH EXECUTE AS '07718158D19D4f5f9D23B55DBF5DF1' instead.

  • Suggested answer
    Mark E Profile Picture
    Mark E 6,405 on at
    RE: error running sp from SL EXECUTE permission was denied on the object 'spname'

    I always put these permissions at the end of each custom proc:

    GRANT EXECUTE ON [dbo].[myproc] TO [E8F575915A2E4897A517779C0DD7CE]

    GO

    GRANT CONTROL ON [dbo].[myproc] TO [MSDSL]

    GO

    GRANT EXECUTE ON [dbo].[myproc] TO [TrustedWebService]

    (last one is if you are using Web Services)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans