Forum Discussion

akaraulli's avatar
akaraulli
Brass Contributor
Feb 16, 2025

"Caller does not have permissions to execute the stored procedure" based on sys procedure

Did create the following procedure on my DB to read SQL Server Log:

USE [MyDB]
GO

ALTER PROCEDURE [OMEGACA].[P_SYS_READ_POL_DEBUG] ( 
    @p_log_no int,
    @p_search_1 nvarchar(4000),
    @p_search_2 nvarchar(4000)
    )
AS

BEGIN

EXEC sys.sp_readerrorlog @p_log_no, 1, @p_search_1, @p_search_2 ;

END;

Schema, DB user and Login is granted server role "sysadmin".

Execute on the above procedure is granted to a certain MyDB's role. 
This role is granted to a certain DB user X (and login).

When this user tries to execute the procedure above, it receives error:
Caller does not have permissions to execute the stored procedure based on sys procedure

Question:
How can I get the needed permission for user X?

ps. Granting sysadmin to X is not liked. 


 

Resources