I have the following problem: there's a user, A, who has to execute a stored procedure (spTest
). In spTest
's body, sp_trace_generateevent
is called.
The problem is that sp_trace_generateevent
requires alter trace permissions, and I don't want user A to have those permissions. I would still like user A to be able to execute spTest
. How can I do that?
Try this:
EXECUTE AS user = 'special_user'
EXECUTE YourProcerdure
REVERT
See these links for more information:
EXECUTE AS
Clause (Transact-SQL)EXECUTE
AS (Transact-SQL)